var lo=Object.defineProperty,no=(e,t,l)=>t in e?lo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,Ce=(e,t,l)=>(no(e,"symbol"!=typeof t?t+"":t,l),l);import{defineComponent as ce,computed as f,openBlock as a,createElementBlock as u,normalizeClass as w,unref as o,createElementVNode as s,createCommentVNode as k,renderSlot as Z,ref as A,toDisplayString as T,inject as Ne,nextTick as xt,isRef as Gn,mergeProps as Me,withModifiers as Ue,h as gt,resolveComponent as X,createBlock as se,withCtx as ke,useAttrs as so,createVNode as $e,createTextVNode as we,watchEffect as hl,normalizeStyle as Xl,Fragment as Te,renderList as Ie,withDirectives as kt,vModelCheckbox as Yl,withKeys as Wn,createStaticVNode as wl,vModelSelect as oo,useSlots as en,getCurrentInstance as Be,onMounted as tt,createSlots as tn,normalizeProps as jt,guardReactiveProps as gl,vModelDynamic as ao,onUnmounted as Rt,watch as Lt,vModelText as io,resolveDynamicComponent as Jn,provide as Xt,resolveDirective as ro}from"vue";import{errorResponseExcept as uo,dateFmt as Xn,toTime as co,omit as dt,enc as Hl,setQueryString as fo,appendQueryString as Kt,nameOf as mo,ApiResult as Je,lastRightPart as $t,leftPart as xl,map as qe,toDate as Vt,toDateTime as vo,toCamelCase as ho,mapGet as ye,chop as go,fromXsdDuration as Yn,isDate as kl,timeFmt12 as po,apiValue as yo,indexOfAny as bo,createBus as wo,toKebabCase as Nn,sanitize as xo,humanize as He,delaySet as es,rightPart as dl,queryString as zl,combinePaths as ko,toPascalCase as st,errorResponse as mt,trimEnd as $o,$1 as pl,lastLeftPart as Co,ResponseStatus as Bl,ResponseError as Un,HttpMethods as ln,uniqueKeys as Nl,humanify as ts,each as _o}from"@servicestack/client";const Lo={class:"flex items-center"},Vo={key:0,class:"flex-shrink-0 mr-3"},So={key:0,class:"h-5 w-5 text-yellow-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},Mo=s("path",{"fill-rule":"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"},null,-1),Ao=[Mo],To={key:1,class:"h-5 w-5 text-red-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},Fo=s("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.28 7.22a.75.75 0 00-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 101.06 1.06L10 11.06l1.72 1.72a.75.75 0 101.06-1.06L11.06 10l1.72-1.72a.75.75 0 00-1.06-1.06L10 8.94 8.28 7.22z","clip-rule":"evenodd"},null,-1),Io=[Fo],Do={key:2,class:"h-5 w-5 text-blue-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},jo=s("path",{"fill-rule":"evenodd",d:"M19 10.5a8.5 8.5 0 11-17 0 8.5 8.5 0 0117 0zM8.25 9.75A.75.75 0 019 9h.253a1.75 1.75 0 011.709 2.13l-.46 2.066a.25.25 0 00.245.304H11a.75.75 0 010 1.5h-.253a1.75 1.75 0 01-1.709-2.13l.46-2.066a.25.25 0 00-.245-.304H9a.75.75 0 01-.75-.75zM10 7a1 1 0 100-2 1 1 0 000 2z","clip-rule":"evenodd"},null,-1),Oo=[jo],Po={key:3,class:"h-5 w-5 text-green-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},Bo=s("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z","clip-rule":"evenodd"},null,-1),Ro=[Bo],Eo=ce({__name:"Alert",props:{type:{default:"warn"},hideIcon:{type:Boolean}},setup(l){const e=l,n=f(()=>"info"==e.type?"bg-blue-50 dark:bg-blue-200":"error"==e.type?"bg-red-50 dark:bg-red-200":"success"==e.type?"bg-green-50 dark:bg-green-200":"bg-yellow-50 dark:bg-yellow-200"),r=f(()=>"info"==e.type?"border-blue-400":"error"==e.type?"border-red-400":"success"==e.type?"border-green-400":"border-yellow-400"),i=f(()=>"info"==e.type?"text-blue-700":"error"==e.type?"text-red-700":"success"==e.type?"text-green-700":"text-yellow-700");return(e,t)=>(a(),u("div",{class:w([o(n),o(r),"border-l-4 p-4"])},[s("div",Lo,[l.hideIcon?k("",!0):(a(),u("div",Vo,["warn"==l.type?(a(),u("svg",So,Ao)):"error"==l.type?(a(),u("svg",To,Io)):"info"==l.type?(a(),u("svg",Do,Oo)):"success"==l.type?(a(),u("svg",Po,Ro)):k("",!0)])),s("div",null,[s("p",{class:w([o(i),"text-sm"])},[Z(e.$slots,"default")],2)])])],2))}}),Ho={key:0,class:"rounded-md bg-green-50 dark:bg-green-200 p-4",role:"alert"},zo={class:"flex"},No=s("div",{class:"flex-shrink-0"},[s("svg",{class:"h-5 w-5 text-green-400 dark:text-green-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"})])],-1),Uo={class:"ml-3"},qo={class:"text-sm font-medium text-green-800"},Qo={key:0},Ko={class:"ml-auto pl-3"},Zo={class:"-mx-1.5 -my-1.5"},Go=s("span",{class:"sr-only"},"Dismiss",-1),Wo=s("svg",{class:"h-5 w-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[s("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"})],-1),Jo=[Go,Wo],Xo=ce({__name:"AlertSuccess",props:{message:null},setup(l){const n=A(!1);return(e,t)=>n.value?k("",!0):(a(),u("div",Ho,[s("div",zo,[No,s("div",Uo,[s("h3",qo,[l.message?(a(),u("span",Qo,T(l.message),1)):Z(e.$slots,"default",{key:1})])]),s("div",Ko,[s("div",Zo,[s("button",{type:"button",class:"inline-flex rounded-md bg-green-50 dark:bg-green-200 p-1.5 text-green-500 dark:text-green-600 hover:bg-green-100 dark:hover:bg-green-700 dark:hover:text-white focus:outline-none focus:ring-2 focus:ring-green-600 focus:ring-offset-2 focus:ring-offset-green-50 dark:ring-offset-green-200",onClick:t[0]||(t[0]=e=>n.value=!0)},Jo)])])])]))}}),Yo={class:"flex"},ea=s("div",{class:"flex-shrink-0"},[s("svg",{class:"h-5 w-5 text-red-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[s("path",{fill:"currentColor",d:"M12 2c5.53 0 10 4.47 10 10s-4.47 10-10 10S2 17.53 2 12S6.47 2 12 2m3.59 5L12 10.59L8.41 7L7 8.41L10.59 12L7 15.59L8.41 17L12 13.41L15.59 17L17 15.59L13.41 12L17 8.41L15.59 7Z"})])],-1),ta={class:"ml-3"},la={class:"text-sm text-red-700 dark:text-red-200"},na=ce({__name:"ErrorSummary",props:{status:null,except:null,class:null},setup(e){const t=e;let l=Ne("ApiState",void 0);const n=f(()=>t.status||null!=l&&l.error.value?uo.call({responseStatus:t.status??(null==l?void 0:l.error.value)},t.except??[]):null);return(e,t)=>o(n)?(a(),u("div",{key:0,class:w("bg-red-50 dark:bg-red-900 border-l-4 border-red-400 p-4 "+e.$props.class)},[s("div",Yo,[ea,s("div",ta,[s("p",la,T(o(n)),1)])])],2)):k("",!0)}}),sa=["id","aria-describedby"],oa=ce({__name:"InputDescription",props:{id:null,description:null},setup(l){return(e,t)=>l.description?(a(),u("div",{key:"description",class:"mt-2 text-sm text-gray-500",id:l.id+"-description","aria-describedby":l.id+"-description"},[s("div",null,T(l.description),1)],8,sa)):k("",!0)}});function $l(e){return Xn(e).replace(/\//g,"-")}function ls(e){return null==e?"":co(e)}function ns(e,t){e.value=null,xt(()=>e.value=t)}function Tt(l){return Object.keys(l).forEach(e=>{var t=l[e];l[e]=Gn(t)?o(t):t}),l}function Ct(e,t,l){l?(t.value=e.entering.cls+" "+e.entering.from,setTimeout(()=>t.value=e.entering.cls+" "+e.entering.to,0)):(t.value=e.leaving.cls+" "+e.leaving.from,setTimeout(()=>t.value=e.leaving.cls+" "+e.leaving.to,0))}function cl(l){if(!("u"<typeof document)){let t=(null==l?void 0:l.after)||document.activeElement,e=t&&t.form;var a;e&&(l=':not([disabled]):not([tabindex="-1"])',l=e.querySelectorAll(`a:not([disabled]), button${l}, input[type=text]${l}, [tabindex]`+l),-1<(a=(l=Array.prototype.filter.call(l,e=>0<e.offsetWidth||0<e.offsetHeight||e===t)).indexOf(t)))&&(l[a+1]||l[0]).focus()}}function Et(e){if(!e)return null;if("string"==typeof e)return e;var t="function"==typeof e?new e:"object"==typeof e?e:null;if(!t)throw new Error(`Invalid DTO Type '${typeof e}'`);if("function"!=typeof t.getTypeName)throw new Error(JSON.stringify(t)+" is not a Request DTO");e=t.getTypeName();if(e)return e;throw new Error("DTO Required")}function rt(e,t,l){var a=(l=l||{}).cls||l.className||l.class;return a&&((l=dt(l,["cls","class","className"])).class=a),null==t?"<"+e+Ul(l)+"/>":"<"+e+Ul(l)+`>${t||""}</${e}>`}function Ul(l){return Object.keys(l).reduce((e,t)=>`${e} ${t}="${Hl(l[t])}"`,"")}function Cl(e){return Object.assign({target:"_blank",rel:"noopener",class:"text-blue-600"},e)}function Dt(e){return kn(e)}let aa=["string","number","boolean","null","undefined"];function _t(e){return 0<=aa.indexOf(typeof e)||e instanceof Date}function Zt(e){return!_t(e)}class ss{get length(){return"u"<typeof localStorage?0:localStorage.length}getItem(e){return"u"<typeof localStorage?null:localStorage.getItem(e)}setItem(e,t){"u"<typeof localStorage||localStorage.setItem(e,t)}removeItem(e){"u"<typeof localStorage||localStorage.removeItem(e)}clear(){"u"<typeof localStorage||localStorage.clear()}key(e){return"u"<typeof localStorage?null:localStorage.key(e)}}function yl(e){return"string"==typeof e?JSON.parse(e):null}function nn(e){typeof history<"u"&&(e=fo(location.href,e),history.pushState({},"",e))}function sn(t,e){if(["function","Function","eval","=>",";"].some(e=>t.includes(e)))throw new Error(`Unsafe script: '${t}'`);e=Object.assign(Object.keys(globalThis).reduce((e,t)=>(e[t]=void 0,e),{}),e);return new Function("with(this) { return ("+t+") }").call(e)}function ql(e){typeof navigator<"u"&&navigator.clipboard.writeText(e)}function on(e){e=ne.config.storage.getItem(e);return e?JSON.parse(e):null}function _l(e,t){return Kt("swr."+mo(e),t?Object.assign({},e,t):e)}function ia(e){e.request&&(e=_l(e.request,e.args),ne.config.storage.removeItem(e))}async function os(e,t,l,a,s){var n=_l(t,a),e=(l(new Je({response:on(n)})),await e.api(t,a,s));return e.succeeded&&e.response&&(e.response._date=(new Date).valueOf(),t=JSON.stringify(e.response),ne.config.storage.setItem(n,t),l(e)),e}function as(t,l){let a=null;return(...e)=>{a&&clearTimeout(a),a=setTimeout(()=>{t(...e)},l||100)}}function pt(e){return"string"==typeof e?e.split(","):e||[]}function wt(e,t){const l=pt(t);return e.reduce((e,t)=>(e[t]=!l.includes(t),e),{})}function is(){return{LocalStore:ss,dateInputFormat:$l,timeInputFormat:ls,setRef:ns,unRefs:Tt,transition:Ct,focusNextElement:cl,getTypeName:Et,htmlTag:rt,htmlAttrs:Ul,linkAttrs:Cl,toAppUrl:Dt,isPrimitive:_t,isComplexType:Zt,pushState:nn,scopedExpr:sn,copyText:ql,fromCache:on,swrCacheKey:_l,swrClear:ia,swrApi:os,asStrings:pt,asOptions:wt,createDebounce:as}}const rs="png,jpg,jpeg,jfif,gif,svg,webp".split(","),us={img:"png,jpg,jpeg,gif,svg,webp,png,jpg,jpeg,gif,bmp,tif,tiff,webp,ai,psd,ps".split(","),vid:"avi,m4v,mov,mp4,mpg,mpeg,wmv,webm".split(","),aud:"mp3,mpa,ogg,wav,wma,mid,webm".split(","),ppt:"key,odp,pps,ppt,pptx".split(","),xls:"xls,xlsm,xlsx,ods,csv,tsv".split(","),doc:"doc,docx,pdf,rtf,tex,txt,md,rst,xls,xlsm,xlsx,ods,key,odp,pps,ppt,pptx".split(","),zip:"zip,tar,gz,7z,rar,gzip,deflate,br,iso,dmg,z,lz,lz4,lzh,s7z,apl,arg,jar,war".split(","),exe:"exe,bat,sh,cmd,com,app,msi,run,vb,vbs,js,ws,wsh".split(","),att:"bin,oct,dat".split(",")},qn=Object.keys(us),ft=(e,t)=>`<svg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' role='img' preserveAspectRatio='xMidYMid meet' viewBox='${e}'>${t}</svg>`,fl={img:ft("4 4 16 16","<path fill='currentColor' d='M20 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2zm-2 0H6v6.38l2.19-2.19l5.23 5.23l1-1a1.59 1.59 0 0 1 2.11.11L18 16V6zm-5 3.5a1.5 1.5 0 1 1 3 0a1.5 1.5 0 0 1-3 0z'/>"),vid:ft("0 0 24 24","<path fill='currentColor' d='m14 2l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8m4 18V9h-5V4H6v16h12m-2-2l-2.5-1.7V18H8v-5h5.5v1.7L16 13v5Z'/>"),aud:ft("0 0 24 24","<path fill='currentColor' d='M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6zm10-9h-4v3.88a2.247 2.247 0 0 0-3.5 1.87c0 1.24 1.01 2.25 2.25 2.25S13 17.99 13 16.75V13h3v-2z'/>"),ppt:ft("0 0 48 48","<g fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='4'><path d='M4 8h40'/><path d='M8 8h32v26H8V8Z' clip-rule='evenodd'/><path d='m22 16l5 5l-5 5m-6 16l8-8l8 8'/></g>"),xls:ft("0 0 256 256","<path fill='currentColor' d='M200 26H72a14 14 0 0 0-14 14v26H40a14 14 0 0 0-14 14v96a14 14 0 0 0 14 14h18v26a14 14 0 0 0 14 14h128a14 14 0 0 0 14-14V40a14 14 0 0 0-14-14Zm-42 76h44v52h-44Zm44-62v50h-44V80a14 14 0 0 0-14-14h-2V38h58a2 2 0 0 1 2 2ZM70 40a2 2 0 0 1 2-2h58v28H70ZM38 176V80a2 2 0 0 1 2-2h104a2 2 0 0 1 2 2v96a2 2 0 0 1-2 2H40a2 2 0 0 1-2-2Zm32 40v-26h60v28H72a2 2 0 0 1-2-2Zm130 2h-58v-28h2a14 14 0 0 0 14-14v-10h44v50a2 2 0 0 1-2 2ZM69.2 148.4L84.5 128l-15.3-20.4a6 6 0 1 1 9.6-7.2L92 118l13.2-17.6a6 6 0 0 1 9.6 7.2L99.5 128l15.3 20.4a6 6 0 0 1-9.6 7.2L92 138l-13.2 17.6a6 6 0 1 1-9.6-7.2Z'/>"),doc:ft("0 0 32 32","<path fill='currentColor' d='M26 30H11a2.002 2.002 0 0 1-2-2v-6h2v6h15V6h-9V4h9a2.002 2.002 0 0 1 2 2v22a2.002 2.002 0 0 1-2 2Z'/><path fill='currentColor' d='M17 10h7v2h-7zm-1 5h8v2h-8zm-1 5h9v2h-9zm-6-1a5.005 5.005 0 0 1-5-5V3h2v11a3 3 0 0 0 6 0V5a1 1 0 0 0-2 0v10H8V5a3 3 0 0 1 6 0v9a5.005 5.005 0 0 1-5 5z'/>"),zip:ft("0 0 16 16","<g fill='currentColor'><path d='M6.5 7.5a1 1 0 0 1 1-1h1a1 1 0 0 1 1 1v.938l.4 1.599a1 1 0 0 1-.416 1.074l-.93.62a1 1 0 0 1-1.109 0l-.93-.62a1 1 0 0 1-.415-1.074l.4-1.599V7.5zm2 0h-1v.938a1 1 0 0 1-.03.243l-.4 1.598l.93.62l.93-.62l-.4-1.598a1 1 0 0 1-.03-.243V7.5z'/><path d='M2 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2zm5.5-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H9v1H8v1h1v1H8v1h1v1H7.5V5h-1V4h1V3h-1V2h1V1z'/></g>"),exe:ft("0 0 16 16","<path fill='currentColor' fill-rule='evenodd' d='M14 4.5V14a2 2 0 0 1-2 2h-1v-1h1a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5L14 4.5ZM2.575 15.202H.785v-1.073H2.47v-.606H.785v-1.025h1.79v-.648H0v3.999h2.575v-.647ZM6.31 11.85h-.893l-.823 1.439h-.036l-.832-1.439h-.931l1.227 1.983l-1.239 2.016h.861l.853-1.415h.035l.85 1.415h.908l-1.254-1.992L6.31 11.85Zm1.025 3.352h1.79v.647H6.548V11.85h2.576v.648h-1.79v1.025h1.684v.606H7.334v1.073Z'/>"),att:ft("0 0 24 24","<path fill='currentColor' d='M14 0a5 5 0 0 1 5 5v12a7 7 0 1 1-14 0V9h2v8a5 5 0 0 0 10 0V5a3 3 0 1 0-6 0v12a1 1 0 1 0 2 0V6h2v11a3 3 0 1 1-6 0V5a5 5 0 0 1 5-5Z'/>")},ra=/[\r\n%#()<>?[\\\]^`{|}]/g,Qn=1024,ua=["Bytes","KB","MB","GB","TB"],da=(()=>{const t="application/",e=t+"vnd.openxmlformats-officedocument.",l="image/",a="text/",s="video/",n={jpg:l+"jpeg",tif:l+"tiff",svg:l+"svg+xml",ico:l+"x-icon",ts:a+"typescript",py:a+"x-python",sh:a+"x-sh",mp3:"audio/mpeg3",mpg:s+"mpeg",ogv:s+"ogg",xlsx:e+"spreadsheetml.sheet",xltx:e+"spreadsheetml.template",docx:e+"wordprocessingml.document",dotx:e+"wordprocessingml.template",pptx:e+"presentationml.presentation",potx:e+"presentationml.template",ppsx:e+"presentationml.slideshow",mdb:t+"vnd.ms-access"};function o(e,t){e.split(",").forEach(e=>n[e]=t)}function r(e,t){e.split(",").forEach(e=>n[e]=t(e))}return r("jpeg,gif,png,tiff,bmp,webp",e=>l+e),r("jsx,csv,css",e=>a+e),r("aac,ac3,aiff,m4a,m4b,m4p,mid,midi,wav",e=>"audio/"+e),r("3gpp,avi,dv,divx,ogg,mp4,webm",e=>s+e),r("rtf,pdf",e=>t+e),o("htm,html,shtm",a+"html"),o("js,mjs,cjs",a+"javascript"),o("yml,yaml",t+"yaml"),o("bat,cmd",t+"bat"),o("xml,csproj,fsproj,vbproj",a+"xml"),o("txt,ps1",a+"plain"),o("qt,mov",s+"quicktime"),o("doc,dot",t+"msword"),o("xls,xlt,xla",t+"excel"),o("ppt,oit,pps,ppa",t+"vnd.ms-powerpoint"),o("cer,crt,der",t+"x-x509-ca-cert"),o("gz,tgz,zip,rar,lzh,z",t+"x-compressed"),o("aaf,aca,asd,bin,cab,chm,class,cur,db,dat,deploy,dll,dsp,exe,fla,ics,inf,mix,msi,mso,obj,ocx,prm,prx,psd,psp,qxd,sea,snp,so,sqlite,toc,ttf,u32,xmp,xsn,xtp",t+"octet-stream"),n})();let Ql=[];function ds(e){return(e=(e=(e=e.replace(/"/g,"'")).replace(/>\s+</g,"><")).replace(/\s{2,}/g," ")).replace(ra,encodeURIComponent)}function an(e){return"data:image/svg+xml;utf8,"+ds(e)}function cs(e){e=URL.createObjectURL(e);return Ql.push(e),e}function fs(){Ql.forEach(e=>{try{URL.revokeObjectURL(e)}catch(e){console.error("URL.revokeObjectURL",e)}}),Ql=[]}function rn(e){return e?(e=xl(e,"?"),$t(e,"/")):null}function Yt(e){e=rn(e);return null==e||-1===e.indexOf(".")?null:$t(e,".").toLowerCase()}function un(e){var t=Yt(e.name);return t&&0<=rs.indexOf(t)?cs(e):yt(e.name)}function dn(e){return e&&(!(!e.startsWith("blob:")&&!e.startsWith("data:"))||(e=Yt(e))&&0<=rs.indexOf(e))||!1}function yt(e){var t;return e?null==(t=Yt(e))||dn(e)?e:Qt(t)||an(fl.doc):null}function Qt(e){e=ms(e);return e&&an(e)||null}function ms(t){if(fl[t])return fl[t];for(let e=0;e<qn.length;e++){var l=qn[e];if(0<=us[l].indexOf(t))return fl[l]}return null}function cn(e,t=2){var l;return 0===e?"0 Bytes":(t=t<0?0:t,l=Math.floor(Math.log(e)/Math.log(Qn)),parseFloat((e/Math.pow(Qn,l)).toFixed(t))+" "+ua[l])}function ca(e){return e.files&&Array.from(e.files).map(e=>({fileName:e.name,contentLength:e.size,filePath:un(e)}))}function Ll(e,t){e.onerror=null,e.src=fn(e.src,t)||""}function fn(e,t){return Qt($t(e,".").toLowerCase())||(t?Qt(t)||t:null)||Qt("doc")}function Kl(e){if(e)return e=$t(e,".").toLowerCase(),da[e]||"application/"+e;throw new Error("fileNameOrExt required")}function $h(){return{extSvg:ms,extSrc:Qt,getExt:Yt,encodeSvg:ds,canPreview:dn,getFileName:rn,getMimeType:Kl,formatBytes:cn,filePathUri:yt,svgToDataUri:an,fileImageUri:un,objectUrl:cs,flush:fs,inputFiles:ca,iconOnError:Ll,iconFallbackSrc:fn}}class fa{constructor(e){Ce(this,"view"),Ce(this,"includeTypes"),Object.assign(this,e)}getTypeName(){return"MetadataApp"}getMethod(){return"GET"}createResponse(){return{}}}const Ot="/metadata/app.json",ma={Boolean:"checkbox",DateTime:"date",DateOnly:"date",DateTimeOffset:"date",TimeSpan:"time",TimeOnly:"time",Byte:"number",Short:"number",Int64:"number",Int32:"number",UInt16:"number",UInt32:"number",UInt64:"number",Single:"number",Double:"number",Decimal:"number",String:"text",Guid:"text",Uri:"text"},va={number:"Int32",checkbox:"Boolean",date:"DateTime","datetime-local":"DateTime",time:"TimeSpan"},Zl={Byte:"byte",Int16:"short",Int32:"int",Int64:"long",UInt16:"ushort",Unt32:"uint",UInt64:"ulong",Single:"float",Double:"double",Decimal:"decimal"},ha=([...Object.keys(Zl),...Object.values(Zl)],{String:"string",Boolean:"bool",...Zl});function rl(e){return ha[e]||e}function vs(e,t){return e?(t=t||[],"Nullable`1"===e?rl(t[0])+"?":e.endsWith("[]")?`List<${rl(e.substring(0,e.length-2))}>`:0===t.length?rl(e):xl(rl(e),"`")+"<"+t.join(",")+">"):""}function ga(e){return e&&vs(e.name,e.genericArgs)}class Pt{constructor(){Ce(this,"Query"),Ce(this,"QueryInto"),Ce(this,"Create"),Ce(this,"Update"),Ce(this,"Patch"),Ce(this,"Delete")}get AnyQuery(){return this.Query||this.QueryInto}get AnyUpdate(){return this.Patch||this.Update}toArray(){return[this.Query,this.QueryInto,this.Create,this.Update,this.Patch,this.Delete].filter(e=>!!e).map(e=>e)}get empty(){return!(this.Query||this.QueryInto||this.Create||this.Update||this.Patch||this.Delete)}add(e){ze.isQueryInto(e)&&!this.QueryInto?this.QueryInto=e:ze.isQuery(e)&&!this.Query?this.Query=e:ze.isCreate(e)&&!this.Create?this.Create=e:ze.isUpdate(e)&&!this.Update?this.Update=e:ze.isPatch(e)&&!this.Patch?this.Patch=e:ze.isDelete(e)&&!this.Delete&&(this.Delete=e)}static from(e){const t=new Pt;return e.forEach(e=>{t.add(e)}),t}static forType(l,e){var t;let a=new Pt;return l&&(null!=(e=e??(null==(t=ne.metadata.value)?void 0:t.api))&&e.operations.forEach(e=>{var t;(null==(t=e.dataModel)?void 0:t.name)==l&&a.add(e)})),a}}const ze={Create:"ICreateDb`1",Update:"IUpdateDb`1",Patch:"IPatchDb`1",Delete:"IDeleteDb`1",AnyRead:["QueryDb`1","QueryDb`2"],AnyWrite:["ICreateDb`1","IUpdateDb`1","IPatchDb`1","IDeleteDb`1"],isAnyQuery:e=>qe(e.request.inherits,e=>0<=ze.AnyRead.indexOf(e.name)),isQuery:e=>qe(e.request.inherits,e=>"QueryDb`1"===e.name),isQueryInto:e=>qe(e.request.inherits,e=>"QueryDb`2"===e.name),isCrud:e=>{return null==(e=e.request.implements)?void 0:e.some(e=>0<=ze.AnyWrite.indexOf(e.name))},isCreate:e=>ul(e,ze.Create),isUpdate:e=>ul(e,ze.Update),isPatch:e=>ul(e,ze.Patch),isDelete:e=>ul(e,ze.Delete),model:e=>{var t;return e?qe(e.inherits,e=>0<=ze.AnyRead.indexOf(e.name))?null==(t=e.inherits)?void 0:t.genericArgs[0]:null==(e=null==(t=e.implements)?void 0:t.find(e=>0<=ze.AnyWrite.indexOf(e.name)))?void 0:e.genericArgs[0]:null}};function pa(e){var t;return(null==(t=e.input)?void 0:t.type)||Vl(mn(e))}function hs(e){return e.endsWith("?")?go(e,1):e}function Vl(e){return ma[hs(e)]}function ya(e){return e&&va[e]||"String"}function mn(e){return"Nullable`1"===e.type?e.genericArgs[0]:e.type}function Gl(e){return e&&"number"==Vl(e)||!1}function gs(e){return e&&"string"==e.toLowerCase()||!1}function ba(e){return"List`1"==e||e.startsWith("List<")||e.endsWith("[]")}function ps(e){var t;return!(null==e||!e.type||(t=mn(e),e.isValueType&&-1==t.indexOf("`"))||e.isEnum||null!=Vl(e.type))}function ys(e){var t;return!!(null!=e&&e.type&&(t=mn(e),e.isValueType&&-1==t.indexOf("`")||e.isEnum||"hidden"==(null==(t=e.input)?void 0:t.type)||"file"==(null==(t=e.input)?void 0:t.type)||"tag"==(null==(t=e.input)?void 0:t.type)||"combobox"==(null==(t=e.input)?void 0:t.type)||null!=Vl(e.type)))}function Gt(e,t){let l="string"==typeof e?Sl(e):e,a=(l||(console.warn("Metadata not found for: "+e),l={request:{name:e}}),function(e){Object.assign(this,e)}),s=(n.prototype.createResponse=function(){return l.returnsVoid?void 0:new a},n.prototype.getTypeName=function(){return l.request.name},n.prototype.getMethod=function(){return l.method||"POST"},n);function n(e){Object.assign(this,e)}return new s(t)}function wa(e,t,l={}){let a=function(e){Object.assign(this,e)},s=(n.prototype.createResponse=function(){return"function"==typeof l.createResponse?l.createResponse():new a},n.prototype.getTypeName=function(){return e},n.prototype.getMethod=function(){return l.method||"POST"},n);function n(e){Object.assign(this,e)}return new s(t)}function ml(l,e){return l?(Object.keys(l).forEach(e=>{var t=l[e];"string"==typeof t?t.startsWith("/Date")&&(l[e]=$l(Vt(t))):"object"==typeof t&&(Array.isArray(t)?l[e]=Array.from(t):l[e]=Object.assign({},t))}),l):{}}function xa(e,r){let i={};return Array.from(e.elements).forEach(a=>{var s;if(a.id&&null!=a.value&&""!==a.value){const n=a.id.toLowerCase(),o=r&&r.find(e=>e.name.toLowerCase()==n);let e=null==o?void 0:o.type,t=null==(s=null==o?void 0:o.genericArgs)?void 0:s[0],l="checkbox"===a.type?a.checked:a.value;Gl(e)?l=Number(l):"List`1"===e&&"string"==typeof l&&(l=l.split(",").map(e=>Gl(t)?Number(e):e)),i[a.id]=l}}),i}function vn(e){var t;return(null==(t=null==e?void 0:e.api)?void 0:t.operations)&&0<e.api.operations.length}function ka(e){if(hn()||null==e||!e.assert||ne.metadata.value)return ne.metadata.value;throw new Error("useMetadata() not configured, see: https://docs.servicestack.net/vue/use-metadata")}function Wt(e){return!(!e||!vn(e)||(e.date=vo(new Date),ne.metadata.value=e,typeof localStorage<"u"&&localStorage.setItem(Ot,JSON.stringify(e)),0))}function $a(){ne.metadata.value=null,typeof localStorage<"u"&&localStorage.removeItem(Ot)}function hn(){if(null!=ne.metadata.value)return!0;var e=globalThis.Server;if(vn(e))Wt(e);else{e=typeof localStorage<"u"?localStorage.getItem(Ot):null;if(e)try{Wt(JSON.parse(e))}catch{console.error(`Could not JSON.parse ${Ot} from localStorage`)}}return null!=ne.metadata.value}async function Kn(e,t){var l,a=t?await t():await fetch(e);a.ok?(l=await a.text(),Wt(JSON.parse(l))):console.error(`Could not download ${t?"AppMetadata":e}: `+a.statusText),vn(ne.metadata.value)||console.warn("AppMetadata is not available")}async function Ca(e){var{olderThan:e,resolvePath:t,resolve:l}=e||{};let a=hn()&&0!==e;if(!(a=a&&e&&(!(s=Vt(null==(s=ne.metadata.value)?void 0:s.date))||(new Date).getTime()-s.getTime()>e)?!1:a)){if((t||l)&&(await Kn(t||Ot,l),null!=ne.metadata.value))return;var s=Ne("client");if(null!=s&&(e=await s.api(new fa)).succeeded&&Wt(e.response),null!=ne.metadata.value)return;await Kn(Ot)}return ne.metadata.value}function ot(t,l){var e,a=null==(a=ne.metadata.value)?void 0:a.api;return a&&t?a.types.find(e=>e.name.toLowerCase()===t.toLowerCase()&&(!l||e.namespace==l))||((e=Sl(t))?e.request:(e=a.operations.find(e=>e.response&&e.response.name.toLowerCase()===t.toLowerCase()&&(!l||e.response.namespace==l)))?e.response:null):null}function Sl(t){var e=null==(e=ne.metadata.value)?void 0:e.api;return e?e.operations.find(e=>e.request.name.toLowerCase()===t.toLowerCase()):null}function _a({dataModel:e}){var t=null==(t=ne.metadata.value)?void 0:t.api;if(!t)return[];let l=t.operations;if(e){const a="string"==typeof e?ot(e):e;l=l.filter(e=>bs(e.dataModel,a))}return l}function gn(e){return e?ot(e.name,e.namespace):null}function bs(e,t){return e&&t&&e.name===t.name&&(!e.namespace||!t.namespace||e.namespace===t.namespace)}function La(e,t){e=ot(e);return e&&e.properties&&e.properties.find(e=>e.name.toLowerCase()===t.toLowerCase())}function ws(e){return xs(ot(e))}function xs(t){if(t&&t.isEnum&&null!=t.enumNames){var l={};for(let e=0;e<t.enumNames.length;e++){var a=(t.enumDescriptions?t.enumDescriptions[e]:null)||t.enumNames[e];l[(null!=t.enumValues?t.enumValues[e]:null)||t.enumNames[e]]=a}return l}return null}function ks(e){if(e){var t={},l=e.input&&e.input.allowableEntries;if(l){for(let e=0;e<l.length;e++){var a=l[e];t[a.key]=a.value}return t}var s=e.allowableValues||(e.input?e.input.allowableValues:null);if(s){for(let e=0;e<s.length;e++){var n=s[e];t[n]=n}return t}if(e.isEnum){e=ot(e.genericArgs&&1==e.genericArgs.length?e.genericArgs[0]:e.type);if(e)return xs(e)}}return null}function pn(t){if(t){const l=[];return Object.keys(t).forEach(e=>l.push({key:e,value:t[e]})),l}}function Va(e,t){a=e.name,l=(null==t?void 0:t.type)||pa(e)||"text";var l,a=Object.assign({id:a,name:a,type:l},t);return e.isEnum&&(a.type="select",a.allowableEntries=pn(ks(e))),a}function Sa(e){let n=[];if(e){const o=et(e),t=Sl(e.name),r=gn(null==t?void 0:t.dataModel);o.forEach(t=>{var e;if(ys(t)){const l=Va(t,t.input);if(l.id=ho(l.id),"file"==l.type&&t.uploadTo&&!l.accept&&(e=null==(e=null==(e=ne.metadata.value)?void 0:e.plugins.filesUpload)?void 0:e.locations.find(e=>e.name==t.uploadTo))&&!l.accept&&e.allowExtensions&&(l.accept=e.allowExtensions.map(e=>e.startsWith(".")?e:"."+e).join(",")),r&&(e=null==(e=r.properties)?void 0:e.find(e=>e.name==t.name),t.ref||(t.ref=null==e?void 0:e.ref)),l.options)try{const a={input:l,$typeFields:o.map(e=>e.name),$dataModelFields:r?et(r).map(e=>e.name):[],...ne.config.scopeWhitelist},s=sn(l.options,a);Object.keys(s).forEach(e=>{l[e]=s[e]})}catch{console.error(`failed to evaluate '${l.options}'`)}n.push(l)}})}return n}function yn(t,e){if(!e.type)return console.error("enumDescriptions missing {type:'EnumType'} options"),[""+t];var l=ot(e.type);if(null==l||!l.enumValues)return console.error("Could not find metadata for "+e.type),[""+t];var a=[];for(let e=0;e<l.enumValues.length;e++){var s=parseInt(l.enumValues[e]);0<s&&(s&t)===s&&a.push((null==(s=l.enumDescriptions)?void 0:s[e])||(null==(s=l.enumNames)?void 0:s[e])||""+t)}return a}function $s(t){return e=>"number"==typeof e?yn(e,{type:t}):e}function et(e){if(!e)return[];let t=[],l={};for(;e;)e.properties&&e.properties.forEach(e=>{l[e.name]||(l[e.name]=1,t.push(e))}),e=e.inherits?gn(e.inherits):null;return t.map(e=>e.type.endsWith("[]")?{...e,type:"List`1",genericArgs:[e.type.substring(0,e.type.length-2)]}:e)}function ul(e,t){return(null==(e=e.request.implements)?void 0:e.some(e=>e.name===t))||!1}function el(e){return e?Cs(e,et(e)):null}function Cs(e,t){var l=t.find(e=>"id"===e.name.toLowerCase());if(l&&l.isPrimaryKey)return l;t=t.find(e=>e.isPrimaryKey)||l;if(!t){l=ze.model(e);if(l)return qe(ot(l),e=>el(e));console.error("Primary Key not found in "+e.name)}return t||null}function Ma(e,t){return qe(el(e),e=>ye(t,e.name))}function _s(e,t,l){return e&&"none"===e.valueType?"":"%In"===l.key||"%Between"===l.key?`(${l.value})`:Aa(t,l.value)}function Aa(e,t){return!e||Gl(e=hs(e))||"Boolean"===e?t:ba(e)?`[${t}]`:`'${t}'`}function at(){var e=f(()=>{var e;return(null==(e=ne.metadata.value)?void 0:e.app)||null}),t=f(()=>{var e;return(null==(e=ne.metadata.value)?void 0:e.api)||null}),l=f(()=>{var e;return(null==(e=ne.metadata.value)?void 0:e.plugins.autoQuery.viewerConventions)||[]});return hn(),{loadMetadata:Ca,getMetadata:ka,setMetadata:Wt,clearMetadata:$a,metadataApp:e,metadataApi:t,filterDefinitions:l,typeOf:ot,typeOfRef:gn,typeEquals:bs,apiOf:Sl,findApis:_a,typeName:ga,typeName2:vs,property:La,enumOptions:ws,propertyOptions:ks,createFormLayout:Sa,typeProperties:et,supportsProp:ys,Crud:ze,Apis:Pt,getPrimaryKey:el,getPrimaryKeyByProps:Cs,getId:Ma,createDto:Gt,makeDto:wa,toFormValues:ml,formValues:xa,isComplexProp:ps,asKvps:pn,expandEnumFlags:yn,enumFlagsConverter:$s}}const Xe=class Xe{static async getOrFetchValue(e,t,l,a,s,n,o){return Xe.getValue(l,o,s)??(await Xe.fetchLookupIds(e,t,l,a,s,n,[o]),Xe.getValue(l,o,s))}static getValue(e,t,l){e=Xe.Lookup[e];if(e){e=e[t];if(e)return e[l=l.toLowerCase()]}}static setValue(e,t,l,a){e=Xe.Lookup[e]??(Xe.Lookup[e]={});(e[t]??(e[t]={}))[l=l.toLowerCase()]=a}static setRefValue(e,t){var l=ye(t,e.refId);return null==l||null==e.refLabel?null:(t=ye(t,e.refLabel),Xe.setValue(e.model,l,e.refLabel,t),t)}static async fetchLookupIds(e,t,l,a,s,n,o){t=t.operations.find(e=>{return ze.isAnyQuery(e)&&(null==(e=e.dataModel)?void 0:e.name)==l});if(t){const r=Xe.Lookup[l]??(Xe.Lookup[l]={}),i=[];Object.keys(r).forEach(e=>{var t=r[e];ye(t,s)&&i.push(e)});var o=o.filter(e=>!i.includes(e));0!=o.length&&(n=n?null:a+","+s,o={[a+"In"]:o.join(",")},n&&(o.fields=n),n=Gt(t,o),(o=await e.api(n,{jsconfig:"edv,eccn"})).succeeded?(ye(o.response,"results")||[]).forEach(e=>{var t,l;ye(e,a)?(t=""+ye(e,a),l=ye(e,s),s=s.toLowerCase(),(r[t]??(r[t]={}))[s]=""+l):console.error(`result[${a}] == null`,e)}):console.error("Failed to call "+t.request.name))}}};Ce(Xe,"Lookup",{});let Ft=Xe,Wl=()=>(new Date).getTime(),Ta=["/","T",":","-"],ut={assumeUtc:!0,date:{method:"Intl.DateTimeFormat",options:"{dateStyle:'medium'}"},maxFieldLength:150,maxNestedFields:2,maxNestedFieldLength:30},Fa=new Intl.RelativeTimeFormat(ut.locale,{}),Zn=31536e6,Rl={year:Zn,month:Zn/12,day:864e5,hour:36e5,minute:6e4,second:1e3},bt={currency:Vs,bytes:Ss,link:Ms,linkTel:As,linkMailTo:Ts,icon:Fs,iconRounded:Is,attachment:Ds,hidden:js,time:Os,relativeTime:wn,relativeTimeFromMs:Ml,enumFlags:Bs,formatDate:Ht,formatNumber:bn};"iconOnError"in globalThis||(globalThis.iconOnError=Ll);class Ke{}function Ia(e){ut=Object.assign({},ut,e)}function Da(t){Object.keys(t||{}).forEach(e=>{"function"==typeof t[e]&&(bt[e]=t[e])})}function Ls(){return bt}function tl(e,t){return t?rt("span",e,t):e}function Vs(e,t){var l=dt(t,["currency"]);return tl(new Intl.NumberFormat(void 0,{style:"currency",currency:(null==t?void 0:t.currency)||"USD"}).format(e),l)}function Ss(e,t){return tl(cn(e),t)}function Ms(e,t){return rt("a",e,Cl({...t,href:e}))}function As(e,t){return rt("a",e,Cl({...t,href:"tel:"+e}))}function Ts(e,t){var{subject:l,body:a}=t=t||{},t=dt(t,["subject","body"]),s={};return l&&(s.subject=l),a&&(s.body=a),rt("a",e,Cl({...t,href:"mailto:"+Kt(e,s)}))}function Fs(e,t){return rt("img",void 0,Object.assign({class:"w-6 h-6",title:e,src:Dt(e),onerror:"iconOnError(this)"},t))}function Is(e,t){return rt("img",void 0,Object.assign({class:"w-8 h-8 rounded-full",title:e,src:Dt(e),onerror:"iconOnError(this)"},t))}function Ds(e,t){var l=rn(e),a=(null==Yt(l)||dn(e)?Dt:fn)(e),a=Dt(a),s=t&&(t["icon-class"]||t.iconClass),a=rt("img",void 0,Object.assign({class:"w-6 h-6",src:a,onerror:"iconOnError(this,'att')"},s?{class:s}:null));return rt("a",a+`<span class="pl-1">${l}</span>`,Object.assign({class:"flex",href:Dt(e),title:e},t?dt(t,["icon-class","iconClass"]):null))}function js(e){return""}function Os(e,t){var l="string"==typeof e?new Date(1e3*Yn(e)):kl(e)?Vt(e):null;return tl(l?po(l):e,t)}function Ht(e,t){var l,a;return null==e?"":(l="number"==typeof e?new Date(e):"string"==typeof e?Vt(e):e,kl(l)?tl(("function"==typeof(a=ut.date?Al(ut.date):null)?a:Xn)(l),t):(console.warn(l+" is not a Date value"),null==e?"":""+e))}function bn(e,t){if("number"!=typeof e)return e;let l=ut.number?Al(ut.number):null,a="function"==typeof l?l(e):""+e;return""===a&&(console.warn(`formatNumber(${e}) => `+a,l),a=""+e),tl(a,t)}function Ps(t,l,a){var e=yo(t),s=l?Al(l):null;if("function"!=typeof s)return(null!=e?kl(e)?Ht(e,a):"number"==typeof e?bn(e,a):e:null)??"";{let e=a;if(null!=l&&l.options)try{e=sn(l.options,a)}catch(e){console.error(`Could not evaluate '${l.options}'`,e,", with scope:",a)}return s(t,e)}}function Jt(e,t,l){return(_t(e)?Ps:Ra)(e,t,l)}function ja(e){if(null!=e){if("number"==typeof e)return e;if(kl(e))return e.getTime()-Wl();if("string"==typeof e){var t=Number(e);if(!isNaN(t))return t;if("P"===e[0]||e.startsWith("-P"))return 1e3*Yn(e)*-1;if(0<=bo(e,Ta))return Vt(e).getTime()-Wl()}}return NaN}function Ml(e,t){for(var l in Rl)if(Math.abs(e)>Rl[l]||"second"===l)return(t||Fa).format(Math.round(e/Rl[l]),l)}function wn(e,t){e=ja(e);return isNaN(e)?"":Ml(e,t)}function Oa(e,t){return Ml(e.getTime()-(t?t.getTime():Wl()))}function Bs(e,t){return yn(e,t).join(", ")}function Al(l){if(l){let{method:e,options:a}=l,s=e+`(${a})`,n=bt[s]||bt[e];if("function"==typeof n)return n;let o=l.locale||ut.locale;if(e.startsWith("Intl.")){l=o?`'${o}'`:"undefined",l=`return new ${e}(${l},${a||"undefined"})`;try{let t=Function(l)();return n="Intl.DateTimeFormat"===e?e=>t.format(Vt(e)):"Intl.NumberFormat"===e?e=>t.format(Number(e)):"Intl.RelativeTimeFormat"===e?e=>wn(e,t):e=>t.format(e),bt[s]=n}catch(e){console.error("Invalid format: "+l,e)}}else{let l=globalThis[e];if("function"==typeof l){let t=null!=a?Function("return "+a)():void 0;return n=e=>l(e,t,o),bt[s]=n}console.error(`No '${e}' function exists`,Object.keys(bt))}}return null}function Rs(e,t){return e?e.length>t?e.substring(0,t)+"...":e:""}function Es(e){return"/Date("===e.substring(0,6)?Ht(Vt(e)):e}function Pa(e){return xn(Bt(e)).replace(/"/g,"")}function Hs(e){if(null==e||""===e)return"";if("string"==typeof e)try{return JSON.parse(e)}catch{console.warn("couldn't parse as JSON",e)}return e}function xn(e,t=4){return"object"!=typeof(e=Hs(e))?"string"==typeof e?e:""+e:JSON.stringify(e,void 0,t)}function Ba(e){return"object"!=typeof(e=Hs(e))?"string"==typeof e?e:""+e:xn(e=Bt(e=Object.assign({},e)))}function Bt(l){if(null==l)return null;if("string"==typeof l)return Es(l);if(_t(l))return l;if(l instanceof Date)return Ht(l);if(Array.isArray(l))return l.map(Bt);if("object"!=typeof l)return l;{let t={};return Object.keys(l).forEach(e=>{"__type"!=e&&(t[e]=Bt(l[e]))}),t}}function Ra(e,t,l){let a=e;if(Array.isArray(e)){if(_t(e[0]))return a.join(",");null!=e[0]&&(a=e[0])}if(null==a)return"";if(a instanceof Date)return Ht(a,l);var s=Object.keys(a),n=[];for(let e=0;e<Math.min(ut.maxNestedFields,s.length);e++){var o=s[e],r=""+Bt(a[o]);n.push(`<b class="font-medium">${o}</b>: `+Hl(Rs(Es(r),ut.maxNestedFieldLength)))}return 2<s.length&&n.push("..."),rt("span","{ "+n.join(", ")+" }",Object.assign({title:Hl(Pa(e))},l))}function Ch(){return{Formats:Ke,setDefaultFormats:Ia,getFormatters:Ls,setFormatters:Da,formatValue:Jt,formatter:Al,dateInputFormat:$l,currency:Vs,bytes:Ss,link:Ms,linkTel:As,linkMailTo:Ts,icon:Fs,iconRounded:Is,attachment:Ds,hidden:js,time:Os,relativeTime:wn,relativeTimeFromDate:Oa,relativeTimeFromMs:Ml,enumFlags:Bs,formatDate:Ht,formatNumber:bn,indentJson:xn,prettyJson:Ba,scrub:Bt,truncate:Rs,apiValueFmt:Ps,iconOnError:Ll}}Ce(Ke,"currency",{method:"currency"}),Ce(Ke,"bytes",{method:"bytes"}),Ce(Ke,"link",{method:"link"}),Ce(Ke,"linkTel",{method:"linkTel"}),Ce(Ke,"linkMailTo",{method:"linkMailTo"}),Ce(Ke,"icon",{method:"icon"}),Ce(Ke,"iconRounded",{method:"iconRounded"}),Ce(Ke,"attachment",{method:"attachment"}),Ce(Ke,"time",{method:"time"}),Ce(Ke,"relativeTime",{method:"relativeTime"}),Ce(Ke,"relativeTimeFromMs",{method:"relativeTimeFromMs"}),Ce(Ke,"date",{method:"formatDate"}),Ce(Ke,"number",{method:"formatNumber"}),Ce(Ke,"hidden",{method:"hidden"}),Ce(Ke,"enumFlags",{method:"enumFlags"});const Ea=["onClick","title"],Ha=ce({__name:"RouterLink",props:{to:null},setup(l){const e=l,t=St()["config"],s=()=>t.value.navigate(e.to??"/");return(e,t)=>(a(),u("a",Me({onClick:Ue(s,["prevent"]),title:l.to,href:"javascript:void(0)"},e.$attrs),[Z(e.$slots,"default")],16,Ea))}});class za{constructor(){Ce(this,"callbacks",{})}register(e,t){this.callbacks[e]=t}has(e){return!!this.callbacks[e]}invoke(e,t){var l=this.callbacks[e];"function"==typeof l&&l(e,t)}}const Ye=class Ye{static component(e){var t=Ye.components[e];if(t)return t;const l=Nn(e),a=Object.keys(Ye.components).find(e=>Nn(e)===l);return a&&Ye.components[a]||null}};Ce(Ye,"config",{redirectSignIn:"/signin",redirectSignOut:"/auth/logout",navigate:e=>location.href=e,assetsPathResolver:e=>e,fallbackPathResolver:e=>e,storage:new ss,tableIcon:{svg:"<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><g fill='none' stroke='currentColor' stroke-width='1.5'><path d='M5 12v6s0 3 7 3s7-3 7-3v-6'/><path d='M5 6v6s0 3 7 3s7-3 7-3V6'/><path d='M12 3c7 0 7 3 7 3s0 3-7 3s-7-3-7-3s0-3 7-3Z'/></g></svg>"},scopeWhitelist:{enumFlagsConverter:$s,...Ls()}}),Ce(Ye,"autoQueryGridDefaults",{deny:[],hide:[],toolbarButtonClass:void 0,tableStyle:"stripedRows",take:25,maxFieldLength:150}),Ce(Ye,"events",wo()),Ce(Ye,"user",A(null)),Ce(Ye,"metadata",A(null)),Ce(Ye,"components",{RouterLink:Ha}),Ce(Ye,"interceptors",new za);let ne=Ye;function Na(e){ne.config=Object.assign(ne.config,e)}function Ua(e){ne.autoQueryGridDefaults=Object.assign(ne.autoQueryGridDefaults,e)}function kn(e){return e&&ne.config.assetsPathResolver?ne.config.assetsPathResolver(e):e}function qa(e){return e&&ne.config.fallbackPathResolver?ne.config.fallbackPathResolver(e):e}function Qa(e,t){ne.interceptors.register(e,t)}function St(){var e=f(()=>ne.config),t=f(()=>ne.autoQueryGridDefaults);return{config:e,setConfig:Na,events:ne.events,autoQueryGridDefaults:t,setAutoQueryGridDefaults:Ua,assetsPathResolver:kn,fallbackPathResolver:qa,registerInterceptor:Qa}}const zs=ce({inheritAttrs:!1,props:{image:Object,svg:String,src:String,alt:String,type:String},setup(s,{attrs:n}){return()=>{let e=s.image;var t,l;s.type&&(l=at()["typeOf"],(l=l(s.type))||console.warn(`Type ${s.type} does not exist`),null!=l&&l.icon?e=null==l?void 0:l.icon:console.warn(`Type ${s.type} does not have a [Svg] icon`));let a=s.svg||(null==e?void 0:e.svg)||"";return a.startsWith("<svg ")?(l=xl(a,">").indexOf("class="),t=`${(null==e?void 0:e.cls)||""} `+(n.class||""),a=-1==l?`<svg class="${t}" `+a.substring(4):(l=l+6+1,a.substring(0,l)+t+" "+a.substring(l)),gt("span",{innerHTML:a})):gt("img",{class:[null==e?void 0:e.cls,n.class],src:kn(s.src||(null==e?void 0:e.uri)),onError:e=>Ll(e.target)})}}}),Ka={class:"text-2xl font-semibold text-gray-900 dark:text-gray-300"},Za={class:"flex"},Ga=s("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"},null,-1),Wa=s("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"},null,-1),Ja=[Ga,Wa],Xa=ce({__name:"Loading",props:{imageClass:{default:"w-6 h-6"}},setup(l){return(e,t)=>(a(),u("div",Ka,[s("div",Za,[(a(),u("svg",{class:w(["self-center inline mr-2 text-gray-200 animate-spin dark:text-gray-600 fill-gray-600 dark:fill-gray-300",l.imageClass]),role:"status",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Ja,2)),s("span",null,[Z(e.$slots,"default")])])]))}}),Ya=["href","onClick"],ei=["type"],ti=ce({__name:"OutlineButton",props:{type:{default:"submit"},href:null},setup(n){const o="inline-flex items-center px-4 py-2 border border-gray-300 dark:border-gray-600 shadow-sm text-sm font-medium rounded-md text-gray-700 dark:text-gray-200 disabled:text-gray-400 bg-white dark:bg-black hover:bg-gray-50 hover:dark:bg-gray-900 disabled:hover:bg-white dark:disabled:hover:bg-black focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:ring-offset-black";return(t,e)=>{var l=X("router-link");return n.href?(a(),se(l,{key:0,to:n.href},{default:ke(({navigate:e})=>[s("button",{class:w(o),href:n.href,onClick:e},[Z(t.$slots,"default")],8,Ya)]),_:3},8,["to"])):(a(),u("button",Me({key:1,type:n.type,class:o},t.$attrs),[Z(t.$slots,"default")],16,ei))}}}),li=["href","onClick"],ni=["type"],si=ce({__name:"PrimaryButton",props:{type:{default:"submit"},href:null,color:{default:"indigo"}},setup(n){const e=n,t={blue:"text-white bg-blue-600 hover:bg-blue-700 disabled:bg-blue-400 disabled:hover:bg-blue-400 focus:ring-indigo-500 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800",purple:"text-white bg-purple-600 hover:bg-purple-700 disabled:bg-purple-400 disabled:hover:bg-purple-400 focus:ring-indigo-500 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800",red:"focus:ring-red-500 text-white bg-red-600 hover:bg-red-700 disabled:bg-red-400 disabled:hover:bg-red-400 focus:ring-red-500 dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-500",green:"focus:ring-green-300 text-white bg-green-600 hover:bg-green-700 disabled:bg-green-400 disabled:hover:bg-green-400 focus:ring-green-500 dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-green-500",sky:"focus:ring-sky-300 text-white bg-sky-600 hover:bg-sky-700 disabled:bg-sky-400 disabled:hover:bg-sky-400 focus:ring-sky-500 dark:bg-sky-600 dark:hover:bg-sky-700 dark:focus:ring-sky-500",cyan:"focus:ring-cyan-300 text-white bg-cyan-600 hover:bg-cyan-700 disabled:bg-cyan-400 disabled:hover:bg-cyan-400 focus:ring-cyan-500 dark:bg-cyan-600 dark:hover:bg-cyan-700 dark:focus:ring-cyan-500",indigo:"focus:ring-2 focus:ring-offset-2 text-white bg-indigo-600 hover:bg-indigo-700 disabled:bg-indigo-400 disabled:hover:bg-indigo-400 focus:ring-indigo-500 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},r=f(()=>"inline-flex justify-center rounded-md border border-transparent py-2 px-4 text-sm font-medium shadow-sm focus:outline-none focus:ring-2 focus:ring-offset-2 dark:ring-offset-black "+(t[e.color]||t.indigo));return(t,e)=>{var l=X("router-link");return n.href?(a(),se(l,{key:0,to:n.href},{default:ke(({navigate:e})=>[s("button",{class:w(o(r)),href:n.href,onClick:e},[Z(t.$slots,"default")],10,li)]),_:3},8,["to"])):(a(),u("button",Me({key:1,type:n.type,class:o(r)},t.$attrs),[Z(t.$slots,"default")],16,ni))}}}),oi=["type","href","onClick"],ai=["type"],ii=ce({__name:"SecondaryButton",props:{type:null,href:null},setup(n){const o="inline-flex justify-center rounded-md border border-gray-300 py-2 px-4 text-sm font-medium shadow-sm focus:outline-none focus:ring-2 focus:ring-offset-2 bg-white dark:bg-gray-800 border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-400 dark:hover:text-white hover:bg-gray-50 dark:hover:bg-gray-700 focus:ring-indigo-500 dark:focus:ring-indigo-600 dark:ring-offset-black";return(t,e)=>{var l=X("router-link");return n.href?(a(),se(l,{key:0,to:n.href},{default:ke(({navigate:e})=>[s("button",{type:n.type??"button",class:w(o),href:n.href,onClick:e},[Z(t.$slots,"default")],8,oi)]),_:3},8,["to"])):(a(),u("button",Me({key:1,type:n.type??"button",class:o},t.$attrs),[Z(t.$slots,"default")],16,ai))}}});function We(e,t){return Array.isArray(e)?0<=e.indexOf(t):e==t||e.includes(t)}const bl={blue:"text-blue-600 dark:text-blue-400 hover:text-blue-800 dark:hover:text-blue-200",purple:"text-purple-600 dark:text-purple-400 hover:text-purple-800 dark:hover:text-purple-200",red:"text-red-700 dark:text-red-400 hover:text-red-900 dark:hover:text-red-200",green:"text-green-600 dark:text-green-400 hover:text-green-800 dark:hover:text-green-200",sky:"text-sky-600 dark:text-sky-400 hover:text-sky-800 dark:hover:text-sky-200",cyan:"text-cyan-600 dark:text-cyan-400 hover:text-cyan-800 dark:hover:text-cyan-200",indigo:"text-indigo-600 dark:text-indigo-400 hover:text-indigo-800 dark:hover:text-indigo-200"},nt={base:"block w-full sm:text-sm rounded-md dark:text-white dark:bg-gray-900 disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none",invalid:"pr-10 border-red-300 text-red-900 placeholder-red-300 focus:outline-none focus:ring-red-500 focus:border-red-500",valid:"shadow-sm focus:ring-indigo-500 focus:border-indigo-500 border-gray-300 dark:border-gray-600"},qt={panelClass:"shadow sm:rounded-md",formClass:"space-y-6 bg-white dark:bg-black py-6 px-4 sm:p-6",headingClass:"text-lg font-medium leading-6 text-gray-900 dark:text-gray-100",subHeadingClass:"mt-1 text-sm text-gray-500 dark:text-gray-400"},It={panelClass:"pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",formClass:"flex h-full flex-col divide-y divide-gray-200 dark:divide-gray-700 shadow-xl bg-white dark:bg-black",titlebarClass:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6",headingClass:"text-lg font-medium text-gray-900 dark:text-gray-100",subHeadingClass:"mt-1 text-sm text-gray-500 dark:text-gray-400",closeButtonClass:"rounded-md bg-gray-50 dark:bg-gray-900 text-gray-400 dark:text-gray-500 hover:text-gray-500 dark:hover:text-gray-400 focus:outline-none focus:ring-2 focus:ring-indigo-500 dark:ring-offset-black"},Jl={modalClass:"relative transform overflow-hidden rounded-lg bg-white dark:bg-black text-left shadow-xl transition-all sm:my-8",sizeClass:"sm:max-w-prose lg:max-w-screen-md xl:max-w-screen-lg 2xl:max-w-screen-xl sm:w-full"},Ze={panelClass(e="slideOver"){return("card"==e?qt:It).panelClass},formClass(e="slideOver"){return("card"==e?qt:It).formClass},headingClass(e="slideOver"){return("card"==e?qt:It).headingClass},subHeadingClass(e="slideOver"){return("card"==e?qt:It).subHeadingClass},buttonsClass:"mt-4 px-4 py-3 bg-gray-50 dark:bg-gray-900 sm:px-6 flex flex-wrap justify-between",legendClass:"text-base font-medium text-gray-900 dark:text-gray-100 text-center mb-4"},ge={getGridClass(e=0){return ge.gridClass},getGrid2Class(e="stripedRows"){return We(e,"fullWidth")?"overflow-x-auto":ge.grid2Class},getGrid3Class(e="stripedRows"){return We(e,"fullWidth")?"inline-block min-w-full py-2 align-middle":ge.grid3Class},getGrid4Class(e="stripedRows"){return We(e,"whiteBackground")?"":We(e,"fullWidth")?"overflow-hidden shadow-sm ring-1 ring-black ring-opacity-5":ge.grid4Class},getTableClass(e="stripedRows"){return We(e,"fullWidth")||We(e,"verticalLines")?"min-w-full divide-y divide-gray-300":ge.tableClass},getTheadClass(e="stripedRows"){return We(e,"whiteBackground")?"":ge.theadClass},getTheadRowClass(e="stripedRows"){return ge.theadRowClass+(We(e,"verticalLines")?" divide-x divide-gray-200 dark:divide-gray-700":"")},getTheadCellClass(e="stripedRows"){return ge.theadCellClass+(We(e,"uppercaseHeadings")?" uppercase":"")},getTbodyClass(e="stripedRows"){return(We(e,"whiteBackground")||We(e,"verticalLines")?"divide-y divide-gray-200 dark:divide-gray-800":ge.tableClass)+(We(e,"verticalLines")?" bg-white":"")},getTableRowClass(e="stripedRows",t,l,a){return(a?"cursor-pointer ":"")+(l?"bg-indigo-100 dark:bg-blue-800":(a?"hover:bg-yellow-50 dark:hover:bg-blue-900 ":"")+(!We(e,"stripedRows")||t%2==0?"bg-white dark:bg-black":"bg-gray-50 dark:bg-gray-800"))+(We(e,"verticalLines")?" divide-x divide-gray-200 dark:divide-gray-700":"")},gridClass:"flex flex-col",grid2Class:"",grid3Class:"inline-block min-w-full py-2 align-middle",grid4Class:"overflow-hidden shadow ring-1 ring-black ring-opacity-5 md:rounded-lg",tableClass:"min-w-full divide-y divide-gray-200 dark:divide-gray-700",theadClass:"bg-gray-50 dark:bg-gray-900",tableCellClass:"px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-400",theadRowClass:"select-none",theadCellClass:"px-6 py-4 text-left text-sm font-medium tracking-wider whitespace-nowrap",toolbarButtonClass:"inline-flex items-center px-2.5 py-1.5 border border-gray-300 dark:border-gray-700 shadow-sm text-sm font-medium rounded text-gray-700 dark:text-gray-300 bg-white dark:bg-black hover:bg-gray-50 dark:hover:bg-gray-900 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:ring-offset-black"},ri={colspans:"col-span-3 sm:col-span-3"},_h=Object.freeze(Object.defineProperty({__proto__:null,a:bl,card:qt,dummy:ri,form:Ze,grid:ge,input:nt,modal:Jl,slideOver:It},Symbol.toStringTag,{value:"Module"})),ui=ce({__name:"TextLink",props:{color:{default:"blue"}},setup(e){const t=e,l=so(),s=f(()=>(bl[t.color]||bl.blue)+(l.href?"":" cursor-pointer"));return(e,t)=>(a(),u("a",{class:w(o(s))},[Z(e.$slots,"default")],2))}}),di={class:"flex","aria-label":"Breadcrumb"},ci={role:"list",class:"flex items-center space-x-4"},fi=["href","title"],mi=s("svg",{class:"h-6 w-6 flex-shrink-0",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[s("path",{"fill-rule":"evenodd",d:"M9.293 2.293a1 1 0 011.414 0l7 7A1 1 0 0117 11h-1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-3a1 1 0 00-1-1H9a1 1 0 00-1 1v3a1 1 0 01-1 1H5a1 1 0 01-1-1v-6H3a1 1 0 01-.707-1.707l7-7z","clip-rule":"evenodd"})],-1),vi={class:"sr-only"},hi=ce({__name:"Breadcrumbs",props:{homeHref:{default:"/"},homeLabel:{default:"Home"}},setup(l){return(e,t)=>(a(),u("nav",di,[s("ol",ci,[s("li",null,[s("div",null,[s("a",{href:l.homeHref,class:"text-gray-400 dark:text-gray-500 hover:text-gray-500 dark:hover:text-gray-400",title:l.homeLabel},[mi,s("span",vi,T(l.homeLabel),1)],8,fi)])]),Z(e.$slots,"default")])]))}}),gi={class:"flex items-center"},pi=s("svg",{class:"h-6 w-6 flex-shrink-0 text-gray-400 dark:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[s("path",{"fill-rule":"evenodd",d:"M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z","clip-rule":"evenodd"})],-1),yi=["href","title"],bi=["title"],wi=ce({__name:"Breadcrumb",props:{href:null,title:null},setup(l){return(e,t)=>(a(),u("li",null,[s("div",gi,[pi,l.href?(a(),u("a",{key:0,href:l.href,class:"ml-4 text-lg font-medium text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300",title:l.title},[Z(e.$slots,"default")],8,yi)):(a(),u("span",{key:1,class:"ml-4 text-lg font-medium text-gray-700 dark:text-gray-300",title:l.title},[Z(e.$slots,"default")],8,bi))])]))}}),xi={key:0,class:"text-base font-semibold text-gray-500 dark:text-gray-400"},ki={role:"list",class:"mt-4 divide-y divide-gray-200 dark:divide-gray-800 border-t border-b border-gray-200 dark:border-gray-800"},$i=ce({__name:"NavList",props:{title:null},setup(l){return(e,t)=>(a(),u("div",null,[l.title?(a(),u("h2",xi,T(l.title),1)):k("",!0),s("ul",ki,[Z(e.$slots,"default")])]))}}),Ci={class:"relative flex items-start space-x-4 py-6"},_i={class:"flex-shrink-0"},Li={class:"flex h-12 w-12 items-center justify-center rounded-lg bg-indigo-50 dark:bg-indigo-900"},Vi={class:"min-w-0 flex-1"},Si={class:"text-base font-medium text-gray-900 dark:text-gray-100"},Mi={class:"rounded-sm focus-within:ring-2 focus-within:ring-indigo-500 focus-within:ring-offset-2"},Ai=["href"],Ti=s("span",{class:"absolute inset-0","aria-hidden":"true"},null,-1),Fi={class:"text-base text-gray-500"},Ii=s("div",{class:"flex-shrink-0 self-center"},[s("svg",{class:"h-5 w-5 text-gray-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[s("path",{"fill-rule":"evenodd",d:"M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z","clip-rule":"evenodd"})])],-1),Di=ce({__name:"NavListItem",props:{title:null,href:null,icon:null,iconSvg:null,iconSrc:null,iconAlt:null},setup(n){return(e,t)=>{var l=X("Icon");return a(),u("li",Ci,[s("div",_i,[s("span",Li,[$e(l,{class:"w-6 h-6 text-indigo-700 dark:text-indigo-300",image:n.icon,src:n.iconSrc,svg:n.iconSvg,alt:n.iconAlt},null,8,["image","src","svg","alt"])])]),s("div",Vi,[s("h3",Si,[s("span",Mi,[s("a",{href:n.href,class:"focus:outline-none"},[Ti,we(" "+T(n.title),1)],8,Ai)])]),s("p",Fi,[Z(e.$slots,"default")])]),Ii])}}});function Ns(e){return e&&e.SessionId?xo(e):e}function ji(e){ne.user.value=Ns(e),ne.events.publish("signIn",e)}function Oi(){ne.user.value=null,ne.events.publish("signOut",null)}const $n=e=>e.roles||[],Cn=e=>e.permissions||[];function Us(e){return 0<=$n(ne.user.value).indexOf(e)}function Pi(e){return 0<=Cn(ne.user.value).indexOf(e)}function _n(){return Us("Admin")}function vl(e){if(!e)return!1;if(!e.requiresAuth)return!0;var t=ne.user.value;if(!t)return!1;if(_n())return!0;let[l,a]=[$n(t),Cn(t)],[s,n,o,r]=[e.requiredRoles||[],e.requiredPermissions||[],e.requiresAnyRole||[],e.requiresAnyPermission||[]];return!(!s.every(e=>0<=l.indexOf(e))||0<o.length&&!o.some(e=>0<=l.indexOf(e))||!n.every(e=>0<=a.indexOf(e))||0<r.length&&!r.every(e=>0<=a.indexOf(e)))}function Bi(e){if(!e||!e.requiresAuth)return null;var t=ne.user.value;if(!t)return`<b>${e.request.name}</b> requires Authentication`;if(_n())return null;let[l,a]=[$n(t),Cn(t)],[s,n,o,r]=[e.requiredRoles||[],e.requiredPermissions||[],e.requiresAnyRole||[],e.requiresAnyPermission||[]],i=s.filter(e=>l.indexOf(e)<0);return 0<i.length?`Requires ${i.map(e=>"<b>"+e+"</b>").join(", ")} Role`+(1<i.length?"s":""):0<(t=n.filter(e=>a.indexOf(e)<0)).length?`Requires ${t.map(e=>"<b>"+e+"</b>").join(", ")} Permission`+(1<t.length?"s":""):0<o.length&&!o.some(e=>0<=l.indexOf(e))?`Requires any ${o.filter(e=>l.indexOf(e)<0).map(e=>"<b>"+e+"</b>").join(", ")} Role`+(1<i.length?"s":""):0<r.length&&!r.every(e=>0<=a.indexOf(e))?`Requires any ${r.filter(e=>a.indexOf(e)<0).map(e=>"<b>"+e+"</b>").join(", ")} Permission`+(1<t.length?"s":""):null}function Ln(){return{signIn:ji,signOut:Oi,user:f(()=>ne.user.value||null),toAuth:Ns,isAuthenticated:f(()=>null!=ne.user.value),hasRole:Us,hasPermission:Pi,isAdmin:_n,canAccess:vl,invalidAccessMessage:Bi}}const Ri={key:0},Ei={class:"md:p-4"},qs=ce({__name:"EnsureAccess",props:{invalidAccess:null,alertClass:null},emits:["done"],setup(r){const i=Ln()["isAuthenticated"],t=St()["config"],d=()=>{var e=location.href.substring(location.origin.length)||"/",e=Kt(t.value.redirectSignIn,{redirect:e});t.value.navigate(e)},c=()=>{var e=location.href.substring(location.origin.length)||"/",e=Kt(t.value.redirectSignOut,{ReturnUrl:e});t.value.navigate(e)};return(e,t)=>{var l=X("Alert"),n=X("SecondaryButton");return r.invalidAccess?(a(),u("div",Ri,[$e(l,{class:w(r.alertClass),innerHTML:r.invalidAccess},null,8,["class","innerHTML"]),s("div",Ei,[o(i)?(a(),se(n,{key:1,onClick:c},{default:ke(()=>[we("Sign Out")]),_:1})):(a(),se(n,{key:0,onClick:d},{default:ke(()=>[we("Sign In")]),_:1}))])])):k("",!0)}}}),Hi={class:"absolute top-0 right-0 bg-white dark:bg-black border dark:border-gray-800 rounded normal-case text-sm shadow w-80"},zi={class:"p-4"},Ni=s("h3",{class:"text-base font-medium mb-3 dark:text-gray-100"},"Sort",-1),Ui={class:"flex w-full justify-center"},qi=s("svg",{class:"w-6 h-6",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},[s("g",{fill:"currentColor"},[s("path",{"fill-rule":"evenodd",d:"M10.082 5.629L9.664 7H8.598l1.789-5.332h1.234L13.402 7h-1.12l-.419-1.371h-1.781zm1.57-.785L11 2.687h-.047l-.652 2.157h1.351z"}),s("path",{d:"M12.96 14H9.028v-.691l2.579-3.72v-.054H9.098v-.867h3.785v.691l-2.567 3.72v.054h2.645V14zm-8.46-.5a.5.5 0 0 1-1 0V3.707L2.354 4.854a.5.5 0 1 1-.708-.708l2-1.999l.007-.007a.498.498 0 0 1 .7.006l2 2a.5.5 0 1 1-.707.708L4.5 3.707V13.5z"})])],-1),Qi=s("span",null,"ASC",-1),Ki=[qi,Qi],Zi=wl('<svg class="w-6 h-6" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><g fill="currentColor"><path d="M12.96 7H9.028v-.691l2.579-3.72v-.054H9.098v-.867h3.785v.691l-2.567 3.72v.054h2.645V7z"></path><path fill-rule="evenodd" d="M10.082 12.629L9.664 14H8.598l1.789-5.332h1.234L13.402 14h-1.12l-.419-1.371h-1.781zm1.57-.785L11 9.688h-.047l-.652 2.156h1.351z"></path><path d="M4.5 2.5a.5.5 0 0 0-1 0v9.793l-1.146-1.147a.5.5 0 0 0-.708.708l2 1.999l.007.007a.497.497 0 0 0 .7-.006l2-2a.5.5 0 0 0-.707-.708L4.5 12.293V2.5z"></path></g></svg><span>DESC</span>',2),Gi=[Zi],Wi=s("h3",{class:"text-base font-medium mt-4 mb-2"}," Filter ",-1),Ji={key:0},Xi=["id","value"],Yi=["for"],er={key:1},tr={class:"mb-2"},lr={class:"inline-flex rounded-full items-center py-0.5 pl-2.5 pr-1 text-sm font-medium bg-indigo-100 text-indigo-700"},nr=["onClick"],sr=s("svg",{class:"h-2 w-2",stroke:"currentColor",fill:"none",viewBox:"0 0 8 8"},[s("path",{"stroke-linecap":"round","stroke-width":"1.5",d:"M1 1l6 6m0-6L1 7"})],-1),or=[sr],ar={class:"flex"},ir=s("svg",{class:"h-6 w-6",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[s("path",{"fill-rule":"evenodd",d:"M10 5a1 1 0 011 1v3h3a1 1 0 110 2h-3v3a1 1 0 11-2 0v-3H6a1 1 0 110-2h3V6a1 1 0 011-1z","clip-rule":"evenodd"})],-1),rr=[ir],ur={class:"bg-gray-50 dark:bg-gray-900 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse"},Vn=ce({__name:"FilterColumn",props:{definitions:null,column:null,topLeft:null},emits:["done","save"],setup(d,{emit:l}){const c=d,v=A(),p=A(""),m=A(""),g=A([]),y=f(()=>1==c.column.meta.isEnum),n=f(()=>ot("Nullable`1"===c.column.meta.type?c.column.meta.genericArgs[0]:c.column.meta.type)),h=f(()=>1==c.column.meta.isEnum?pn(ws(n.value.name)):[]),b=f(()=>{var e;return(null==(e=r(c.column.type))?void 0:e.map(e=>({key:e.value,value:e.name})))||[]}),x=A({filters:[]}),C=f(()=>x.value.filters);function r(e){let t=c.definitions;return t=gs(e)?t:t.filter(e=>"string"!==e.types)}function L(e,t){return r(e).find(e=>e.value===t)}function V(){var e;p.value&&(e=null==(e=L(c.column.type,p.value))?void 0:e.name)&&(x.value.filters.push({key:p.value,name:e,value:m.value}),p.value=m.value="")}function M(){l("done")}function S(){var e;p.value="%",null!=(e=v.value)&&e.focus()}function I(){var e,t;m.value&&V(),y.value&&(t=Object.values(g.value).filter(e=>e),x.value.filters=0<t.length?null!=(e=n.value)&&e.isEnumInt?[{key:"%HasAny",name:"HasAny",value:t.map(e=>parseInt(e)).reduce((e,t)=>e+t,0).toString()}]:[{key:"%In",name:"In",value:t.join(",")}]:[]),l("save",x.value),l("done")}function $(e){x.value.sort=e===x.value.sort?void 0:e,xt(I)}return hl(()=>x.value=Object.assign({},c.column.settings,{filters:Array.from(c.column.settings.filters)})),hl(()=>{var e;let t=(null==(e=null==(e=null==(e=c.column.settings.filters)?void 0:e[0])?void 0:e.value)?void 0:e.split(","))||[];if(0<t.length&&null!=(e=n.value)&&e.isEnumInt){const l=parseInt(t[0]);t=(null==(e=n.value.enumValues)?void 0:e.filter(e=>0<(l&parseInt(e))))||[]}g.value=t}),(e,t)=>{var l=X("SelectInput"),n=X("TextInput"),r=X("PrimaryButton"),i=X("SecondaryButton");return a(),u("div",{class:"fixed z-20 inset-0 overflow-y-auto",onClick:M,onVnodeMounted:S},[s("div",{class:"absolute",style:Xl(`top:${d.topLeft.y}px;left:${d.topLeft.x}px`),onClick:t[5]||(t[5]=Ue(()=>{},["stop"]))},[s("div",Hi,[s("div",zi,[Ni,s("div",Ui,[s("button",{type:"button",title:"Sort Ascending",onClick:t[0]||(t[0]=e=>$("ASC")),class:w(`${"ASC"===x.value.sort?"bg-indigo-100 border-indigo-500":"bg-white hover:bg-gray-50 border-gray-300"} mr-1 inline-flex items-center px-2.5 py-1.5 border shadow-sm text-sm font-medium rounded text-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500`)},Ki,2),s("button",{type:"button",title:"Sort Descending",onClick:t[1]||(t[1]=e=>$("DESC")),class:w(`${"DESC"===x.value.sort?"bg-indigo-100 border-indigo-500":"bg-white hover:bg-gray-50 border-gray-300"} ml-1 inline-flex items-center px-2.5 py-1.5 border shadow-sm text-sm font-medium rounded text-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500`)},Gi,2)]),Wi,o(y)?(a(),u("div",Ji,[(a(!0),u(Te,null,Ie(o(h),e=>(a(),u("div",{key:e.key,class:"flex items-center"},[kt(s("input",{type:"checkbox",id:e.key,value:e.key,"onUpdate:modelValue":t[2]||(t[2]=e=>g.value=e),class:"h-4 w-4 border-gray-300 rounded text-indigo-600 focus:ring-indigo-500"},null,8,Xi),[[Yl,g.value]]),s("label",{for:e.key,class:"ml-3"},T(e.value),9,Yi)]))),128))])):(a(),u("div",er,[(a(!0),u(Te,null,Ie(o(C),(e,l)=>{return a(),u("div",tr,[s("span",lr,[we(T(d.column.name)+" "+T(e.name)+" "+T((e=e,_s(L(c.column.type,e.key),c.column.type,e)))+" ",1),s("button",{type:"button",onClick:e=>{var t;t=l,x.value.filters.splice(t,1)},class:"flex-shrink-0 ml-0.5 h-4 w-4 rounded-full inline-flex items-center justify-center text-indigo-400 hover:bg-indigo-200 hover:text-indigo-500 focus:outline-none focus:bg-indigo-500 focus:text-white"},or,8,nr)])])}),256)),s("div",ar,[$e(l,{id:"filterRule",class:"w-32 mr-1",modelValue:p.value,"onUpdate:modelValue":t[3]||(t[3]=e=>p.value=e),entries:o(b),label:"",placeholder:""},null,8,["modelValue","entries"]),"none"!==(null==(l=L(d.column.type,p.value))?void 0:l.valueType)?(a(),se(n,{key:0,ref_key:"txtFilter",ref:v,id:"filterValue",class:"w-32 mr-1",type:"text",modelValue:m.value,"onUpdate:modelValue":t[4]||(t[4]=e=>m.value=e),onKeyup:Wn(V,["enter"]),label:"",placeholder:""},null,8,["modelValue","onKeyup"])):k("",!0),s("div",{class:"pt-1"},[s("button",{type:"button",onClick:V,class:"inline-flex items-center p-1 border border-transparent rounded-full shadow-sm text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"},rr)])])]))]),s("div",ur,[$e(r,{onClick:I,color:"red",class:"ml-2"},{default:ke(()=>[we(" Save ")]),_:1}),$e(i,{onClick:M},{default:ke(()=>[we(" Cancel ")]),_:1})])])],4)],512)}}}),dr={class:"px-4 sm:px-6 lg:px-8 text-sm"},cr={class:"flex flex-wrap"},fr={class:"group pr-4 sm:pr-6 lg:pr-8"},mr={class:"flex justify-between w-full font-medium"},vr={class:"w-6 flex justify-end"},hr={class:"hidden group-hover:inline"},gr=["onClick","title"],pr=s("svg",{class:"h-2 w-2",stroke:"currentColor",fill:"none",viewBox:"0 0 8 8"},[s("path",{"stroke-linecap":"round","stroke-width":"1.5",d:"M1 1l6 6m0-6L1 7"})],-1),yr=[pr],br={key:0,class:"pt-2"},wr={class:"ml-2"},xr={key:1},kr={class:"pt-2"},$r={class:"inline-flex rounded-full items-center py-0.5 pl-2.5 pr-1 text-sm font-medium bg-indigo-100 text-indigo-700"},Cr=["onClick"],_r=s("svg",{class:"h-2 w-2",stroke:"currentColor",fill:"none",viewBox:"0 0 8 8"},[s("path",{"stroke-linecap":"round","stroke-width":"1.5",d:"M1 1l6 6m0-6L1 7"})],-1),Lr=[_r],Vr=s("span",null,"Clear All",-1),Sr=[Vr],Sn=ce({__name:"FilterViews",props:{definitions:null,columns:null},emits:["done","change"],setup(e,{emit:r}){const l=e,n=f(()=>l.columns.filter(e=>0<e.settings.filters.length));function i(e,t){return function(e){let t=l.definitions;return t=gs(e)?t:t.filter(e=>"string"!==e.types)}(e).find(e=>e.value===t)}function d(){l.columns.forEach(e=>{e.settings.filters=[],r("change",e)}),r("done")}return(e,t)=>(a(),u("div",dr,[s("div",cr,[(a(!0),u(Te,null,Ie(o(n),n=>{return a(),u("fieldset",fr,[s("legend",mr,[s("span",null,T(o(He)(n.name)),1),s("span",vr,[s("span",hr,[s("button",{onClick:e=>{var t;(t=n).settings.filters=[],r("change",t)},title:`Clear all ${o(He)(n.name)} filters`,class:"flex-shrink-0 ml-0.5 h-4 w-4 rounded-full inline-flex items-center justify-center text-red-600 hover:bg-red-200 hover:text-red-500 focus:outline-none focus:bg-red-500 focus:text-white"},yr,8,gr)])])]),n.meta.isEnum?(a(),u("div",br,[(a(!0),u(Te,null,Ie(null==(e=null==(e=null==(e=n.settings.filters)?void 0:e[0])?void 0:e.value)?void 0:e.split(","),e=>(a(),u("div",{key:e,class:"flex items-center"},[s("label",wr,T(e),1)]))),128))])):(a(),u("div",xr,[(a(!0),u(Te,null,Ie(n.settings.filters,(e,l)=>{return a(),u("div",kr,[s("span",$r,[we(T(n.name)+" "+T(e.name)+" "+T((e=e,_s(i((t=n).type,e.value),t.type,e)))+" ",1),s("button",{type:"button",onClick:e=>{var t;(t=n).settings.filters.splice(l,1),r("change",t)},class:"flex-shrink-0 ml-0.5 h-4 w-4 rounded-full inline-flex items-center justify-center text-indigo-400 hover:bg-indigo-200 hover:text-indigo-500 focus:outline-none focus:bg-indigo-500 focus:text-white"},Lr,8,Cr)])]);var t}),256))]))]);var e}),256))]),s("div",{class:"flex justify-center pt-4"},[s("button",{type:"button",onClick:d,class:"inline-flex items-center px-2.5 py-1.5 border border-gray-300 shadow-sm text-sm font-medium rounded text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"},Sr)])]))}}),Mr={class:"bg-white dark:bg-black px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},Ar={class:""},Tr={class:"mt-3 text-center sm:mt-0 sm:mx-4 sm:text-left"},Fr=s("h3",{class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-100"},"Query Preferences",-1),Ir={class:"mt-4"},Dr=["for"],jr=["id"],Or=["value","selected"],Pr={class:"mt-4 flex items-center py-4 border-b border-gray-200 dark:border-gray-800"},Br=["id","checked"],Rr=["for"],Er={class:"mt-4"},Hr={class:"pb-2 px-4"},zr={class:""},Nr=["id","value"],Ur=["for"],qr={class:"bg-gray-50 dark:bg-gray-900 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse"},Mn=ce({__name:"QueryPrefs",props:{id:{default:"QueryPrefs"},columns:null,prefs:null,maxLimit:null},emits:["done","save"],setup(r,{emit:e}){const i=r,t=St()["autoQueryGridDefaults"],d=A({}),c=(hl(()=>d.value=Object.assign({take:t.value.take,selectedColumns:[]},i.prefs)),[10,25,50,100,250,500,1e3]);function v(){e("done")}function f(){e("save",d.value)}return(e,t)=>{const l=X("PrimaryButton"),n=X("SecondaryButton"),o=X("ModalDialog");return a(),se(o,{id:r.id,onDone:v,"size-class":"w-full sm:max-w-prose"},{default:ke(()=>[s("div",Mr,[s("div",Ar,[s("div",Tr,[Fr,s("div",Ir,[s("label",{for:r.id+"-take",class:"block text-sm font-medium text-gray-700 dark:text-gray-300"},"Results per page",8,Dr),kt(s("select",{id:r.id+"-take","onUpdate:modelValue":t[0]||(t[0]=e=>d.value.take=e),class:"mt-1 block w-full pl-3 pr-10 py-2 text-base bg-white dark:bg-black border-gray-300 dark:border-gray-700 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm rounded-md"},[(a(!0),u(Te,null,Ie(c.filter(e=>null==i.maxLimit||e<=i.maxLimit),e=>(a(),u("option",{value:e,selected:e===d.value.take},T(e),9,Or))),256))],8,jr),[[oo,d.value.take]])]),s("div",Pr,[s("input",{type:"radio",id:r.id+"-allColumns",onClick:t[1]||(t[1]=e=>d.value.selectedColumns=[]),checked:0===d.value.selectedColumns.length,class:"focus:ring-indigo-500 h-4 w-4 bg-white dark:bg-black text-indigo-600 dark:text-indigo-400 border-gray-300 dark:border-gray-700"},null,8,Br),s("label",{class:"ml-3 block text-gray-700 dark:text-gray-300",for:r.id+"-allColumns"},"View all columns",8,Rr)]),s("div",Er,[s("div",Hr,[s("div",zr,[(a(!0),u(Te,null,Ie(r.columns,e=>(a(),u("div",{key:e.name,class:"flex items-center"},[kt(s("input",{type:"checkbox",id:e.name,value:e.name,"onUpdate:modelValue":t[2]||(t[2]=e=>d.value.selectedColumns=e),class:"h-4 w-4 bg-white dark:bg-black border-gray-300 dark:border-gray-700 rounded text-indigo-600 dark:text-indigo-400 focus:ring-indigo-500"},null,8,Nr),[[Yl,d.value.selectedColumns]]),s("label",{for:e.name,class:"ml-3"},T(e.name),9,Ur)]))),128))])])])])])]),s("div",qr,[$e(l,{onClick:f,color:"red",class:"ml-2"},{default:ke(()=>[we(" Save ")]),_:1}),$e(n,{onClick:v},{default:ke(()=>[we(" Cancel ")]),_:1})])]),_:1},8,["id"])}}}),Qr={key:0},Kr={key:1},Zr={key:2,class:"pt-1"},Gr={key:0},Wr={key:1},Jr={key:3},Xr={class:"pl-1 pt-1 flex flex-wrap"},Yr={class:"flex mt-1"},eu=["title"],tu=s("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[s("g",{"stroke-width":"1.5",fill:"none"},[s("path",{d:"M9 3H3.6a.6.6 0 0 0-.6.6v16.8a.6.6 0 0 0 .6.6H9M9 3v18M9 3h6M9 21h6m0-18h5.4a.6.6 0 0 1 .6.6v16.8a.6.6 0 0 1-.6.6H15m0-18v18",stroke:"currentColor"})])],-1),lu=[tu],nu=["disabled"],su=s("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[s("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6l6 6zM6 6h2v12H6z",fill:"currentColor"})],-1),ou=[su],au=["disabled"],iu=s("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[s("path",{d:"M15.41 7.41L14 6l-6 6l6 6l1.41-1.41L10.83 12z",fill:"currentColor"})],-1),ru=[iu],uu=["disabled"],du=s("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[s("path",{d:"M10 6L8.59 7.41L13.17 12l-4.58 4.59L10 18l6-6z",fill:"currentColor"})],-1),cu=[du],fu=["disabled"],mu=s("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[s("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6l-6-6zM16 6h2v12h-2z",fill:"currentColor"})],-1),vu=[mu],hu={key:0,class:"flex mt-1"},gu={class:"px-4 text-lg text-black dark:text-white"},pu={key:0},yu={key:1},bu=s("span",{class:"hidden xl:inline"}," Showing Results ",-1),wu={key:2},xu={class:"flex flex-wrap"},ku={key:0,class:"pl-2 mt-1"},$u=s("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[s("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 20v-5h-5M4 4v5h5m10.938 2A8.001 8.001 0 0 0 5.07 8m-1.008 5a8.001 8.001  0 0 0 14.868 3"})],-1),Cu=[$u],_u={key:1,class:"pl-2 mt-1"},Lu=wl('<svg class="w-5 h-5 mr-1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M28.781 4.405h-10.13V2.018L2 4.588v22.527l16.651 2.868v-3.538h10.13A1.162 1.162 0 0 0 30 25.349V5.5a1.162 1.162 0 0 0-1.219-1.095zm.16 21.126H18.617l-.017-1.889h2.487v-2.2h-2.506l-.012-1.3h2.518v-2.2H18.55l-.012-1.3h2.549v-2.2H18.53v-1.3h2.557v-2.2H18.53v-1.3h2.557v-2.2H18.53v-2h10.411z" fill="#20744a" fill-rule="evenodd"></path><path fill="#20744a" d="M22.487 7.439h4.323v2.2h-4.323z"></path><path fill="#20744a" d="M22.487 10.94h4.323v2.2h-4.323z"></path><path fill="#20744a" d="M22.487 14.441h4.323v2.2h-4.323z"></path><path fill="#20744a" d="M22.487 17.942h4.323v2.2h-4.323z"></path><path fill="#20744a" d="M22.487 21.443h4.323v2.2h-4.323z"></path><path fill="#fff" fill-rule="evenodd" d="M6.347 10.673l2.146-.123l1.349 3.709l1.594-3.862l2.146-.123l-2.606 5.266l2.606 5.279l-2.269-.153l-1.532-4.024l-1.533 3.871l-2.085-.184l2.422-4.663l-2.238-4.993z"></path></svg><span class="text-green-900 dark:text-green-100">Excel</span>',2),Vu=[Lu],Su={key:2,class:"pl-2 mt-1"},Mu={key:0,class:"w-5 h-5 mr-1 text-green-600 dark:text-green-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Au=s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"},null,-1),Tu=[Au],Fu={key:1,class:"w-5 h-5 mr-1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Iu=s("g",{fill:"none"},[s("path",{d:"M8 4v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V7.242a2 2 0 0 0-.602-1.43L16.083 2.57A2 2 0 0 0 14.685 2H10a2 2 0 0 0-2 2z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),s("path",{d:"M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1),Du=[Iu],ju=s("span",{class:"whitespace-nowrap"},"Copy URL",-1),Ou={key:3,class:"pl-2 mt-1"},Pu=s("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",viewBox:"0 0 24 24"},[s("path",{fill:"currentColor",d:"M6.78 2.72a.75.75 0 0 1 0 1.06L4.56 6h8.69a7.75 7.75 0 1 1-7.75 7.75a.75.75 0 0 1 1.5 0a6.25 6.25 0 1 0 6.25-6.25H4.56l2.22 2.22a.75.75 0 1 1-1.06 1.06l-3.5-3.5a.75.75 0 0 1 0-1.06l3.5-3.5a.75.75 0 0 1 1.06 0Z"})],-1),Bu=[Pu],Ru={key:4,class:"pl-2 mt-1"},Eu=s("svg",{class:"flex-none w-5 h-5 mr-2 text-gray-400 dark:text-gray-500 group-hover:text-gray-500","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[s("path",{"fill-rule":"evenodd",d:"M3 3a1 1 0 011-1h12a1 1 0 011 1v3a1 1 0 01-.293.707L12 11.414V15a1 1 0 01-.293.707l-2 2A1 1 0 018 17v-5.586L3.293 6.707A1 1 0 013 6V3z","clip-rule":"evenodd"})],-1),Hu={class:"mr-1"},zu={key:0,class:"h-5 w-5 text-gray-400 dark:text-gray-500 group-hover:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},Nu=s("path",{"fill-rule":"evenodd",d:"M10 5a1 1 0 011 1v3h3a1 1 0 110 2h-3v3a1 1 0 11-2 0v-3H6a1 1 0 110-2h3V6a1 1 0 011-1z","clip-rule":"evenodd"},null,-1),Uu=[Nu],qu={key:1,class:"h-5 w-5 text-gray-400 dark:text-gray-500 group-hover:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},Qu=s("path",{"fill-rule":"evenodd",d:"M5 10a1 1 0 011-1h8a1 1 0 110 2H6a1 1 0 01-1-1z","clip-rule":"evenodd"},null,-1),Ku=[Qu],Zu={key:5,class:"pl-2 mt-1"},Gu=["title"],Wu=s("svg",{class:"w-5 h-5 mr-1 text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-50",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[s("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z",fill:"currentColor"})],-1),Ju={class:"whitespace-nowrap"},Xu={key:7},Yu={key:0,class:"cursor-pointer flex justify-between items-center hover:text-gray-900 dark:hover:text-gray-50"},ed={class:"mr-1 select-none"},td={key:1,class:"flex justify-between items-center"},ld={class:"mr-1 select-none"},nd=ce({__name:"AutoQueryGrid",props:{filterDefinitions:null,id:{default:"AutoQueryGrid"},apis:null,type:null,prefs:null,deny:null,hide:null,selectedColumns:null,toolbarButtonClass:null,tableStyle:null,gridClass:null,grid2Class:null,grid3Class:null,grid4Class:null,tableClass:null,theadClass:null,tbodyClass:null,theadRowClass:null,theadCellClass:null,headerTitle:null,headerTitles:null,visibleFrom:null,rowClass:null,rowStyle:null,apiPrefs:null,canFilter:null,disableKeyBindings:null,configureField:null,skip:{default:0},create:{type:Boolean},edit:null,filters:null},emits:["headerSelected","rowSelected"],setup(p,{expose:e,emit:v}){const r=p,{config:t,autoQueryGridDefaults:W}=St(),G=W,J=Ne("client"),l=t.value.storage,Y="filtering,queryString,queryFilters".split(","),ee="copyApiUrl,downloadCsv,filtersView,newItem,pagingInfo,pagingNav,preferences,refresh,resetPreferences,toolbar".split(","),te=f(()=>r.deny?wt(Y,r.deny):wt(Y,G.value.deny)),le=f(()=>r.hide?wt(ee,r.hide):wt(ee,G.value.hide));function m(e){return te.value[e]}function g(e){return le.value[e]}const y=f(()=>r.tableStyle??G.value.tableStyle),ae=f(()=>r.gridClass??ge.getGridClass(y.value)),oe=f(()=>r.grid2Class??ge.getGrid2Class(y.value)),re=f(()=>r.grid3Class??ge.getGrid3Class(y.value)),ie=f(()=>r.grid4Class??ge.getGrid4Class(y.value)),ue=f(()=>r.tableClass??ge.getTableClass(y.value)),de=f(()=>r.theadClass??ge.getTheadClass(y.value)),ce=f(()=>r.theadRowClass??ge.getTheadRowClass(y.value)),ve=f(()=>r.theadCellClass??ge.getTheadCellClass(y.value)),h=f(()=>r.toolbarButtonClass??ge.toolbarButtonClass);function fe(e,t){var l,a;return r.rowClass?r.rowClass(e,t):(l=!!q.value.AnyUpdate,a=(null!=(a=i.value)&&a.name?ye(e,i.value.name):null)==S.value,ge.getTableRowClass(r.tableStyle,t,a,l))}const b=en(),pe=f(()=>{var e;return st((null==(e=q.value.AnyQuery.viewModel)?void 0:e.name)||q.value.AnyQuery.dataModel.name)}),me=f(()=>{const t=Object.keys(b).map(e=>e.toLowerCase());return et(pe.value).filter(e=>t.includes(e.name.toLowerCase())||t.includes(e.name.toLowerCase()+"-header")).map(e=>e.name)});const x=f(()=>{var e=(0<(e=pt(r.selectedColumns)).length?e:0<me.value.length?me.value:[]).map(e=>e.toLowerCase());const l=et(pe.value);return 0<e.length?e.map(t=>l.find(e=>e.name.toLowerCase()===t)).filter(e=>null!=e):l}),he=f(()=>{let e=x.value.map(e=>e.name),t=pt(O.value.selectedColumns).map(e=>e.toLowerCase());return 0<t.length?e.filter(e=>t.includes(e.toLowerCase())):e}),C=A([]),L=A(new Je),be=A(new Je),V=A(),M=A(!1),S=A(),I=A(),$=A(!1),F=A(),B=A(r.skip),j=A(!1),O=A({take:25}),H=A(!1),xe=f(()=>C.value.some(e=>0<e.settings.filters.length||!!e.settings.sort)||O.value.selectedColumns),Ce=f(()=>C.value.map(e=>e.settings.filters.length).reduce((e,t)=>e+t,0)),Le=f(()=>{var e;return et(st(d.value||(null==(e=q.value.AnyQuery)?void 0:e.dataModel.name)))}),i=f(()=>{var e;return el(st(d.value||(null==(e=q.value.AnyQuery)?void 0:e.dataModel.name)))}),D=f(()=>O.value.take??25),E=f(()=>L.value.response?ye(L.value.response,"results"):[]),z=f(()=>{var e;return(null==(e=L.value.response)?void 0:e.total)??E.value.length??0}),Te=f(()=>0<B.value),Ae=f(()=>0<B.value),Ve=f(()=>E.value.length>=D.value),Me=f(()=>E.value.length>=D.value),_=A(),R=A(),Se={NoQuery:"No Query API was found"};function Fe(t){if(t){if(r.canFilter)return r.canFilter(t);var e=Le.value.find(e=>e.name.toLowerCase()==t.toLowerCase());if(e)return!ps(e)}}function n(e){m("queryString")&&nn(e)}async function N(e){B.value+=e,B.value<0&&(B.value=0);e=Math.floor(z.value/D.value)*D.value;B.value>e&&(B.value=e),n({skip:B.value||void 0}),await P()}async function je(e,t){var l,a;I.value=null,S.value=t,e&&t&&(a=Gt(q.value.AnyQuery,{[e]:t}),(a=await J.api(a)).succeeded)&&((a=null==(a=ye(a.response,"results"))?void 0:a[0])||console.warn(`API ${null==(l=q.value.AnyQuery)?void 0:l.request.name}(${e}:${t}) returned no results`),I.value=a)}async function Oe(e,t){v("rowSelected",e,t);t=null==(t=i.value)?void 0:t.name,e=t?ye(e,t):null;t&&e&&(n({edit:e}),je(t,e))}function He(t,e){var l,a,s;m("filtering")&&(l=e.target,Fe(t)&&"TD"!==(null==l?void 0:l.tagName)&&(l=null==(l=null==l?void 0:l.closest("TABLE"))?void 0:l.getBoundingClientRect(),a=C.value.find(e=>e.name.toLowerCase()==t.toLowerCase()))&&l&&(s=l.x+318+10,F.value={column:a,topLeft:{x:Math.max(Math.floor(e.clientX+159),s),y:l.y+45}}),v("headerSelected",t,e))}function De(){F.value=null}async function Ee(e){var t=null==(t=F.value)?void 0:t.column;t&&(t.settings=e,l.setItem(c(t.name),JSON.stringify(t.settings)),await P()),F.value=null}async function ze(e){l.setItem(c(e.name),JSON.stringify(e.settings)),await P()}async function _e(e){$.value=!1,O.value=e,l.setItem(Ye(),JSON.stringify(e)),await P()}function Re(e){Object.assign(I.value,e),Pe()}function Pe(){null!=(e=_.value)&&e.forceUpdate(),null!=(e=R.value)&&e.forceUpdate();var e=Be();null!=(e=null==e?void 0:e.proxy)&&e.$forceUpdate()}async function P(){await Ue(qe())}async function Ze(){await P()}async function Ue(a){var s=q.value.AnyQuery;if(s){let e=Gt(s,a),t=es(e=>{L.value.response=L.value.error=void 0,H.value=e}),l=await J.api(e);t(),xt(()=>L.value=l);s=ye(l.response,"results")||[];l.succeeded&&s.label}else console.error(Se.NoQuery)}function qe(){let a={include:"total",take:D.value},t=pt(O.value.selectedColumns||r.selectedColumns);if(0<t.length){var l=i.value;l&&!t.includes(l.name)&&(t=[l.name,...t]);const s=Le.value,n=[];t.forEach(t=>{var e,l=s.find(e=>e.name.toLowerCase()==t.toLowerCase());null!=(e=null==l?void 0:l.ref)&&e.selfId&&n.push(l.ref.selfId),ye(b,t)&&n.push(...s.filter(e=>{return(null==(e=null==(e=e.ref)?void 0:e.selfId)?void 0:e.toLowerCase())==t.toLowerCase()}).map(e=>e.name))}),n.forEach(e=>{t.includes(e)||t.push(e)}),a.fields=t.join(",")}let e=[];if(C.value.forEach(l=>{l.settings.sort&&e.push(("DESC"===l.settings.sort?"-":"")+l.name),l.settings.filters.forEach(e=>{var t=e.key.replace("%",l.name);a[t]=e.value})}),r.filters&&Object.keys(r.filters).forEach(e=>{a[e]=r.filters[e]}),m("queryString")&&m("queryFilters")){var l=location.search||(location.hash.includes("?")?"?"+dl(location.hash,"?"):"");let e=zl(l);Object.keys(e).forEach(t=>{x.value.find(e=>e.name.toLowerCase()===t.toLowerCase())&&(a[t]=e[t])}),typeof e.skip<"u"&&(l=parseInt(e.skip),isNaN(l)||(B.value=a.skip=l))}return"u"<typeof a.skip&&0<B.value&&(a.skip=B.value),0<e.length&&(a.orderBy=e.join(",")),a}function Xe(){var e=Ke("csv");ql(e),typeof window<"u"&&window.open(e)}function Qe(){ql(Ke("json")),j.value=!0,setTimeout(()=>j.value=!1,3e3)}function Ke(e="json"){var t=qe(),l="/api/"+(null==(l=q.value.AnyQuery)?void 0:l.request.name),l=ko(J.baseUrl,Kt(l,{...t,jsconfig:"edv"}));return 0<=l.indexOf("?")?xl(l,"?")+"."+e+"?"+dl(l,"?"):l+".json"}async function We(){C.value.forEach(e=>{e.settings={filters:[]},l.removeItem(c(e.name))}),O.value={take:25},l.removeItem(Ye()),await P()}function Ge(){M.value=!0,n({create:null})}e({update:P,search:Ue,createRequestArgs:qe,reset:bt,createDone:K,createSave:ht,editDone:Q,editSave:yt,forceUpdate:Pe,setEdit:Re,edit:I}),ne.interceptors.has("AutoQueryGrid.new")&&ne.interceptors.invoke("AutoQueryGrid.new",{props:r});const d=f(()=>Et(r.type)),U=f(()=>{var e;return d.value||(null==(e=q.value.AnyQuery)?void 0:e.dataModel.name)}),Ye=()=>{var e;return r.id+"/ApiPrefs/"+(d.value||(null==(e=q.value.AnyQuery)?void 0:e.dataModel.name))},c=e=>{var t;return`Column/${r.id}:${d.value||(null==(t=q.value.AnyQuery)?void 0:t.dataModel.name)}.`+e},{metadataApi:lt,typeOf:st,apiOf:nt,filterDefinitions:ot}=at(),rt=Ln()["invalidAccessMessage"],it=f(()=>r.filterDefinitions||ot.value),q=f(()=>{var e=pt(r.apis);return 0<e.length?Pt.from(e.map(e=>nt(e)).filter(e=>null!=e).map(e=>e)):Pt.forType(d.value,lt.value)}),ut=e=>`<span class="text-yellow-700">${e}</span>`,dt=f(()=>{var e;return lt.value?0<(e=pt(r.apis).map(e=>null==nt(e)?e:null).filter(e=>null!=e)).length?ut(`Unknown API${1<e.length?"s":""}: `+e.join(", ")):(e=q.value).empty?ut("Mising DataModel in property 'type' or AutoQuery APIs to use in property 'apis'"):e.AnyQuery?null:ut(Se.NoQuery):ut(`AppMetadata not loaded, see <a class="${bl.blue}" href="https://docs.servicestack.net/vue/use-metadata" target="_blank">useMetadata()</a>`)}),ct=f(()=>q.value.AnyQuery&&rt(q.value.AnyQuery)),vt=f(()=>q.value.Create&&rt(q.value.Create)),ft=f(()=>q.value.AnyUpdate&&rt(q.value.AnyUpdate)),mt=f(()=>vl(q.value.Create)),gt=(f(()=>vl(q.value.AnyUpdate)),f(()=>vl(q.value.Delete)));function Q(){I.value=null,S.value=null,n({edit:void 0})}function K(){M.value=!1,n({create:void 0})}async function yt(){await P(),Q()}async function ht(){await P(),K()}function bt(){L.value=new Je,be.value=new Je,M.value=!1,S.value=null,I.value=null,$.value=!1,F.value=null,B.value=r.skip,j.value=!1,O.value={take:25},H.value=!1;var e,t=r.prefs||yl(l.getItem(Ye())),t=(t&&(O.value=t),C.value=x.value.map(e=>({name:e.name,type:e.type,meta:e,settings:Object.assign({filters:[]},yl(l.getItem(c(e.name))))})),isNaN(r.skip)||(B.value=r.skip),null==(t=i.value)?void 0:t.name);m("queryString")&&(e=location.search||(location.hash.includes("?")?"?"+dl(location.hash,"?"):""),typeof(e=zl(e)).create<"u"?M.value=typeof e.create<"u":!t||"string"!=typeof e.edit&&"number"!=typeof e.edit||je(t,e.edit)),!0===r.create&&(M.value=!0),t&&null!=r.edit&&je(t,r.edit)}return tt(async()=>{bt(),await P()}),(l,e)=>{const t=X("Alert"),n=X("EnsureAccessDialog"),r=X("AutoCreateForm"),i=X("AutoEditForm"),d=X("ErrorSummary"),c=X("Loading"),v=X("SettingsIcons"),f=X("DataGrid");return o(dt)?(a(),u("div",Qr,[$e(t,{innerHTML:o(dt)},null,8,["innerHTML"])])):o(ct)?(a(),u("div",Kr,[$e(qs,{"invalid-access":o(ct)},null,8,["invalid-access"])])):(a(),u("div",Zr,[M.value&&o(q).Create?(a(),u("div",Gr,[o(vt)?(a(),se(n,{key:0,title:"Create "+o(U),"invalid-access":o(vt),"alert-class":"text-yellow-700",onDone:K},null,8,["title","invalid-access"])):o(b).createform?Z(l.$slots,"createform",{key:1,type:o(q).Create.request.name,configure:p.configureField,done:K,save:ht}):(a(),se(r,{key:2,ref_key:"createForm",ref:_,type:o(q).Create.request.name,configure:p.configureField,onDone:K,onSave:ht},{header:ke(()=>[Z(l.$slots,"formheader",{form:"create",formInstance:_.value,apis:o(q),type:o(U)})]),footer:ke(()=>[Z(l.$slots,"formfooter",{form:"create",formInstance:_.value,apis:o(q),type:o(U)})]),_:3},8,["type","configure"]))])):I.value&&o(q).AnyUpdate?(a(),u("div",Wr,[o(ft)?(a(),se(n,{key:0,title:"Update "+o(U),"invalid-access":o(ft),"alert-class":"text-yellow-700",onDone:Q},null,8,["title","invalid-access"])):o(b).editform?Z(l.$slots,"editform",{key:1,model:I.value,type:o(q).AnyUpdate.request.name,deleteType:o(gt)?o(q).Delete.request.name:null,configure:p.configureField,done:Q,save:yt}):(a(),se(i,{key:2,ref_key:"editForm",ref:R,modelValue:I.value,"onUpdate:modelValue":e[0]||(e[0]=e=>I.value=e),type:o(q).AnyUpdate.request.name,deleteType:o(gt)?o(q).Delete.request.name:null,configure:p.configureField,onDone:Q,onSave:yt,onDelete:yt},{header:ke(()=>[Z(l.$slots,"formheader",{form:"edit",formInstance:R.value,apis:o(q),type:o(U),model:I.value,id:S.value,updateModel:Re})]),footer:ke(()=>[Z(l.$slots,"formfooter",{form:"edit",formInstance:R.value,apis:o(q),type:o(U),model:I.value,id:S.value,updateModel:Re})]),_:3},8,["modelValue","type","deleteType","configure"]))])):k("",!0),o(b).toolbar?Z(l.$slots,"toolbar",{key:2}):g("toolbar")?(a(),u("div",Jr,[$.value?(a(),se(Mn,{key:0,columns:o(x),prefs:O.value,onDone:e[1]||(e[1]=e=>$.value=!1),onSave:_e},null,8,["columns","prefs"])):k("",!0),s("div",Xr,[s("div",Yr,[g("preferences")?(a(),u("button",{key:0,type:"button",class:"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400",title:o(U)+" Preferences",onClick:e[2]||(e[2]=e=>$.value=!$.value)},lu,8,eu)):k("",!0),g("pagingNav")?(a(),u("button",{key:1,type:"button",class:w(["pl-2",o(Te)?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"First page",disabled:!o(Te),onClick:e[3]||(e[3]=e=>N(-o(z)))},ou,10,nu)):k("",!0),g("pagingNav")?(a(),u("button",{key:2,type:"button",class:w(["pl-2",o(Ae)?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"Previous page",disabled:!o(Ae),onClick:e[4]||(e[4]=e=>N(-o(D)))},ru,10,au)):k("",!0),g("pagingNav")?(a(),u("button",{key:3,type:"button",class:w(["pl-2",o(Ve)?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"Next page",disabled:!o(Ve),onClick:e[5]||(e[5]=e=>N(o(D)))},cu,10,uu)):k("",!0),g("pagingNav")?(a(),u("button",{key:4,type:"button",class:w(["pl-2",o(Me)?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"Last page",disabled:!o(Me),onClick:e[6]||(e[6]=e=>N(o(z)))},vu,10,fu)):k("",!0)]),g("pagingInfo")?(a(),u("div",hu,[s("div",gu,[H.value?(a(),u("span",pu,"Querying...")):k("",!0),o(E).length?(a(),u("span",yu,[bu,we(" "+T(B.value+1)+" - "+T(Math.min(B.value+o(E).length,o(z)))+" ",1),s("span",null," of "+T(o(z)),1)])):L.value.completed?(a(),u("span",wu,"No Results")):k("",!0)])])):k("",!0),s("div",xu,[g("refresh")?(a(),u("div",ku,[s("button",{type:"button",onClick:Ze,title:"Refresh",class:w(o(h))},Cu,2)])):k("",!0),g("downloadCsv")?(a(),u("div",_u,[s("button",{type:"button",onClick:Xe,title:"Download CSV",class:w(o(h))},Vu,2)])):k("",!0),g("copyApiUrl")?(a(),u("div",Su,[s("button",{type:"button",onClick:Qe,title:"Copy API URL",class:w(o(h))},[j.value?(a(),u("svg",Mu,Tu)):(a(),u("svg",Fu,Du)),ju],2)])):k("",!0),o(xe)&&g("resetPreferences")?(a(),u("div",Ou,[s("button",{type:"button",onClick:We,title:"Reset Preferences & Filters",class:w(o(h))},Bu,2)])):k("",!0),g("filtersView")&&0<o(Ce)?(a(),u("div",Ru,[s("button",{type:"button",onClick:e[7]||(e[7]=e=>V.value="filters"==V.value?null:"filters"),class:w(o(h)),"aria-expanded":"false"},[Eu,s("span",Hu,T(o(Ce))+" "+T(1==o(Ce)?"Filter":"Filters"),1),"filters"!=V.value?(a(),u("svg",zu,Uu)):(a(),u("svg",qu,Ku))],2)])):k("",!0),g("newItem")&&o(q).Create&&o(mt)?(a(),u("div",Zu,[s("button",{type:"button",onClick:Ge,title:o(U),class:w(o(h))},[Wu,s("span",Ju,"New "+T(o(U)),1)],10,Gu)])):k("",!0),o(b).toolbarbuttons?Z(l.$slots,"toolbarbuttons",{key:6,toolbarButtonClass:o(h)}):k("",!0)])])])):k("",!0),"filters"==V.value?(a(),se(Sn,{key:4,class:"border-y border-gray-200 dark:border-gray-800 py-8 my-2",definitions:o(it),columns:C.value,onDone:e[8]||(e[8]=e=>V.value=null),onChange:ze},null,8,["definitions","columns"])):k("",!0),be.value.error??L.value.error?(a(),se(d,{key:5,status:be.value.error??L.value.error},null,8,["status"])):H.value?(a(),se(c,{key:6,class:"p-2"})):k("",!0),F.value?(a(),u("div",Xu,[$e(Vn,{definitions:o(it),column:F.value.column,"top-left":F.value.topLeft,onDone:De,onSave:Ee},null,8,["definitions","column","top-left"])])):k("",!0),o(E).length?(a(),se(f,{key:8,id:p.id,items:o(E),type:p.type,"selected-columns":o(he),class:"mt-1",onFiltersChanged:P,tableStyle:o(y),gridClass:o(ae),grid2Class:o(oe),grid3Class:o(re),grid4Class:o(ie),tableClass:o(ue),theadClass:o(de),theadRowClass:o(ce),theadCellClass:o(ve),tbodyClass:p.tbodyClass,rowClass:fe,onRowSelected:Oe,rowStyle:p.rowStyle,headerTitle:p.headerTitle,headerTitles:p.headerTitles,visibleFrom:p.visibleFrom,onHeaderSelected:He},tn({header:ke(({column:t,label:e})=>{var l;return[m("filtering")&&Fe(t)?(a(),u("div",Yu,[s("span",ed,T(e),1),$e(v,{column:C.value.find(e=>e.name.toLowerCase()===t.toLowerCase()),"is-open":(null==(l=F.value)?void 0:l.column.name)===t},null,8,["column","is-open"])])):(a(),u("div",td,[s("span",ld,T(e),1)]))]}),_:2},[Ie(Object.keys(o(b)),t=>({name:t,fn:ke(e=>[Z(l.$slots,t,jt(gl(e)))])}))]),1032,["id","items","type","selected-columns","tableStyle","gridClass","grid2Class","grid3Class","grid4Class","tableClass","theadClass","theadRowClass","theadCellClass","tbodyClass","rowStyle","headerTitle","headerTitles","visibleFrom"])):k("",!0)]))}}}),sd={class:"flex"},od={key:0,class:"w-4 h-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},ad=s("g",{fill:"none"},[s("path",{d:"M3 4a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1v2.586a1 1 0 0 1-.293.707l-6.414 6.414a1 1 0 0 0-.293.707V17l-4 4v-6.586a1 1 0 0 0-.293-.707L3.293 7.293A1 1 0 0 1 3 6.586V4z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1),id=[ad],rd=s("path",{d:"M505.5 658.7c3.2 4.4 9.7 4.4 12.9 0l178-246c3.8-5.3 0-12.7-6.5-12.7H643c-10.2 0-19.9 4.9-25.9 13.2L512 558.6L406.8 413.2c-6-8.3-15.6-13.2-25.9-13.2H334c-6.5 0-10.3 7.4-6.5 12.7l178 246z",fill:"currentColor"},null,-1),ud=s("path",{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z",fill:"currentColor"},null,-1),dd=[rd,ud],cd={key:2,class:"w-4 h-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},fd=s("g",{fill:"none"},[s("path",{d:"M8.998 4.71L6.354 7.354a.5.5 0 1 1-.708-.707L9.115 3.18A.499.499 0 0 1 9.498 3H9.5a.5.5 0 0 1 .354.147l.01.01l3.49 3.49a.5.5 0 1 1-.707.707l-2.65-2.649V16.5a.5.5 0 0 1-1 0V4.71z",fill:"currentColor"})],-1),md=[fd],vd={key:3,class:"w-4 h-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},hd=s("g",{fill:"none"},[s("path",{d:"M10.002 15.29l2.645-2.644a.5.5 0 0 1 .707.707L9.886 16.82a.5.5 0 0 1-.384.179h-.001a.5.5 0 0 1-.354-.147l-.01-.01l-3.49-3.49a.5.5 0 1 1 .707-.707l2.648 2.649V3.5a.5.5 0 0 1 1 0v11.79z",fill:"currentColor"})],-1),gd=[hd],pd=ce({__name:"SettingsIcons",props:{column:null,isOpen:{type:Boolean}},setup(s){return(e,t)=>{var l;return a(),u("div",sd,[null!=(l=null==(l=null==(l=s.column)?void 0:l.settings)?void 0:l.filters)&&l.length?(a(),u("svg",od,id)):(a(),u("svg",{key:1,class:w(["w-4 h-4 transition-transform",s.isOpen?"rotate-180":""]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},dd,2)),"ASC"===(null==(l=null==(l=s.column)?void 0:l.settings)?void 0:l.sort)?(a(),u("svg",cd,md)):"DESC"===(null==(l=null==(l=s.column)?void 0:l.settings)?void 0:l.sort)?(a(),u("svg",vd,gd)):k("",!0)])}}}),yd=ce({__name:"EnsureAccessDialog",props:{title:null,subtitle:null,invalidAccess:null,alertClass:null},emits:["done"],setup(n){return(t,e)=>{const l=X("EnsureAccess"),s=X("SlideOver");return n.invalidAccess?(a(),se(s,{key:0,title:n.title,onDone:e[0]||(e[0]=e=>t.$emit("done")),"content-class":"relative flex-1"},tn({default:ke(()=>[$e(l,{alertClass:n.alertClass,invalidAccess:n.invalidAccess},null,8,["alertClass","invalidAccess"])]),_:2},[n.subtitle?{name:"subtitle",fn:ke(()=>[we(T(n.subtitle),1)]),key:"0"}:void 0]),1032,["title"])):k("",!0)}}}),bd=["for"],wd={class:"mt-1 relative rounded-md shadow-sm"},xd=["type","name","id","placeholder","value","aria-invalid","aria-describedby"],kd={key:0,class:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none"},$d=s("svg",{class:"h-5 w-5 text-red-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[s("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})],-1),Cd=[$d],_d=["id"],Ld=["id"],Vd={inheritAttrs:!1},Sd=ce({...Vd,__name:"TextInput",props:{status:null,id:null,type:null,inputClass:null,label:null,labelClass:null,help:null,placeholder:null,modelValue:null},setup(l,{expose:e}){const t=l,n=(e({focus:function(){var e;null!=(e=n.value)&&e.focus()}}),A());const r=f(()=>t.type||"text"),i=f(()=>t.label??He(st(t.id))),d=f(()=>t.placeholder??i.value);let c=Ne("ApiState",void 0);const v=f(()=>mt.call({responseStatus:t.status??(null==c?void 0:c.error.value)},t.id)),p=f(()=>[nt.base,v.value?nt.invalid:nt.valid,t.inputClass]);return(t,e)=>(a(),u("div",{class:w([t.$attrs.class])},[Z(t.$slots,"header",Me({inputElement:n.value,id:l.id,modelValue:l.modelValue,status:l.status},t.$attrs)),o(i)?(a(),u("label",{key:0,for:l.id,class:w("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(l.labelClass??""))},T(o(i)),11,bd)):k("",!0),s("div",wd,[s("input",Me({ref_key:"inputElement",ref:n,type:o(r),name:l.id,id:l.id,class:o(p),placeholder:o(d),value:l.modelValue,onInput:e[0]||(e[0]=e=>t.$emit("update:modelValue",e.target.value)),"aria-invalid":null!=o(v),"aria-describedby":l.id+"-error",step:"any"},o(dt)(t.$attrs,["class"])),null,16,xd),o(v)?(a(),u("div",kd,Cd)):k("",!0)]),o(v)?(a(),u("p",{key:1,class:"mt-2 text-sm text-red-500",id:l.id+"-error"},T(o(v)),9,_d)):l.help?(a(),u("p",{key:2,class:"mt-2 text-sm text-gray-500",id:l.id+"-description"},T(l.help),9,Ld)):k("",!0),Z(t.$slots,"footer",Me({inputElement:n.value,id:l.id,modelValue:l.modelValue,status:l.status},t.$attrs))],2))}}),Md=["for"],Ad={class:"mt-1 relative rounded-md shadow-sm"},Td=["name","id","placeholder","aria-invalid","aria-describedby"],Fd=["id"],Id=["id"],Dd={inheritAttrs:!1},jd=ce({...Dd,__name:"TextareaInput",props:{status:null,id:null,inputClass:null,label:null,labelClass:null,help:null,placeholder:null,modelValue:null},setup(l){const e=l,n=f(()=>e.label??He(st(e.id))),r=f(()=>e.placeholder??n.value);let t=Ne("ApiState",void 0);const i=f(()=>mt.call({responseStatus:e.status??(null==t?void 0:t.error.value)},e.id)),d=f(()=>["shadow-sm "+nt.base,i.value?"text-red-900 focus:ring-red-500 focus:border-red-500 border-red-300":"text-gray-900 "+nt.valid,e.inputClass]);return(t,e)=>(a(),u("div",{class:w([t.$attrs.class])},[o(n)?(a(),u("label",{key:0,for:l.id,class:w("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(l.labelClass??""))},T(o(n)),11,Md)):k("",!0),s("div",Ad,[s("textarea",Me({name:l.id,id:l.id,class:o(d),placeholder:o(r),onInput:e[0]||(e[0]=e=>t.$emit("update:modelValue",e.target.value)),"aria-invalid":null!=o(i),"aria-describedby":l.id+"-error"},o(dt)(t.$attrs,["class"])),T(l.modelValue),17,Td)]),o(i)?(a(),u("p",{key:1,class:"mt-2 text-sm text-red-500",id:l.id+"-error"},T(o(i)),9,Fd)):l.help?(a(),u("p",{key:2,class:"mt-2 text-sm text-gray-500",id:l.id+"-description"},T(l.help),9,Id)):k("",!0)],2))}}),Od=["for"],Pd=["id","name","value","aria-invalid","aria-describedby"],Bd=["value"],Rd=["id"],Ed={inheritAttrs:!1},Hd=ce({...Ed,__name:"SelectInput",props:{status:null,id:null,modelValue:null,inputClass:null,label:null,labelClass:null,options:null,values:null,entries:null},setup(l){const t=l,n=f(()=>t.label??He(st(t.id)));let e=Ne("ApiState",void 0);const r=f(()=>mt.call({responseStatus:t.status??(null==e?void 0:e.error.value)},t.id)),i=f(()=>t.entries||(t.values?t.values.map(e=>({key:e,value:e})):t.options?Object.keys(t.options).map(e=>({key:e,value:t.options[e]})):[]));return(t,e)=>(a(),u("div",{class:w([t.$attrs.class])},[o(n)?(a(),u("label",{key:0,for:l.id,class:w("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(l.labelClass??""))},T(o(n)),11,Od)):k("",!0),s("select",Me({id:l.id,name:l.id,class:["mt-1 block w-full pl-3 pr-10 py-2 text-base focus:outline-none sm:text-sm rounded-md dark:text-white dark:bg-gray-900 dark:border-gray-600",o(r)?"border-red-300 text-red-900 focus:ring-red-500 focus:border-red-500":"border-gray-300 text-gray-900 focus:ring-indigo-500 focus:border-indigo-500",l.inputClass],value:l.modelValue,onInput:e[0]||(e[0]=e=>t.$emit("update:modelValue",e.target.value)),"aria-invalid":null!=o(r),"aria-describedby":l.id+"-error"},o(dt)(t.$attrs,["class"])),[(a(!0),u(Te,null,Ie(o(i),e=>(a(),u("option",{value:e.key},T(e.value),9,Bd))),256))],16,Pd),o(r)?(a(),u("p",{key:1,class:"mt-2 text-sm text-red-500",id:l.id+"-error"},T(o(r)),9,Rd)):k("",!0)],2))}}),zd={class:"flex items-center h-5"},Nd=["id","name","checked"],Ud={class:"ml-3 text-sm"},qd=["for"],Qd={key:0,class:"mt-2 text-sm text-red-500",id:"`${id}-error`"},Kd={key:1,class:"mt-2 text-sm text-gray-500",id:"`${id}-description`"},Zd={inheritAttrs:!1},Gd=ce({...Zd,__name:"CheckboxInput",props:{modelValue:{type:Boolean},status:null,id:null,inputClass:null,label:null,labelClass:null,help:null},emits:["update:modelValue"],setup(l,{}){const e=l,n=f(()=>e.label??He(st(e.id)));let t=Ne("ApiState",void 0);const r=f(()=>mt.call({responseStatus:e.status??(null==t?void 0:t.error.value)},e.id));return(t,e)=>(a(),u("div",{class:w(["relative flex items-start",t.$attrs.class])},[s("div",zd,[s("input",Me({id:l.id,name:l.id,type:"checkbox",checked:l.modelValue,onInput:e[0]||(e[0]=e=>t.$emit("update:modelValue",e.target.checked)),class:["focus:ring-indigo-500 h-4 w-4 text-indigo-600 rounded border-gray-300 dark:border-gray-600 dark:bg-gray-800",l.inputClass]},o(dt)(t.$attrs,["class"])),null,16,Nd)]),s("div",Ud,[s("label",{for:l.id,class:w("font-medium text-gray-700 dark:text-gray-300 "+(l.labelClass??""))},T(o(n)),11,qd),o(r)?(a(),u("p",Qd,T(o(r)),1)):l.help?(a(),u("p",Kd,T(l.help),1)):k("",!0)])],2))}}),Wd=["id"],Jd=["for"],Xd={class:"mt-1 relative rounded-md shadow-sm"},Yd=["id","name","value"],ec=["onClick"],tc={class:"flex flex-wrap pb-1.5"},lc={class:"pt-1.5 pl-1"},nc={class:"inline-flex rounded-full items-center py-0.5 pl-2.5 pr-1 text-sm font-medium bg-indigo-100 dark:bg-indigo-800 text-indigo-700 dark:text-indigo-300"},sc=["onClick"],oc=s("svg",{class:"h-2 w-2",stroke:"currentColor",fill:"none",viewBox:"0 0 8 8"},[s("path",{"stroke-linecap":"round","stroke-width":"1.5",d:"M1 1l6 6m0-6L1 7"})],-1),ac=[oc],ic={class:"pt-1.5 pl-1 shrink"},rc=["type","name","id","aria-invalid","aria-describedby","onPaste"],uc=["id"],dc=["onMouseover","onClick"],cc={class:"block truncate"},fc={key:1,class:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none"},mc=s("svg",{class:"h-5 w-5 text-red-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[s("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})],-1),vc=[mc],hc=["id"],gc=["id"],pc={inheritAttrs:!1},yc=ce({...pc,__name:"TagInput",props:{status:null,id:null,type:null,inputClass:null,label:null,labelClass:null,help:null,modelValue:{default:()=>[]},delimiters:{default:()=>[","]},allowableValues:null,string:{type:Boolean},converter:null},emits:["update:modelValue"],setup(l,{emit:t}){const n=l;const r=f(()=>{return qe((e=n.modelValue,n.converter?n.converter(e):e),e=>"string"==typeof e?0==e.trim().length?[]:e.split(","):e)||[];var e}),i=A(),d=A(!1),c=f(()=>n.allowableValues&&0!=n.allowableValues.length?n.allowableValues.filter(e=>!r.value.includes(e)&&e.toLowerCase().includes(p.value.toLowerCase())):[]);const v=A(null),p=A(""),m=f(()=>n.type||"text"),g=f(()=>n.label??He(st(n.id)));let e=Ne("ApiState",void 0);const y=f(()=>mt.call({responseStatus:n.status??(null==e?void 0:e.error.value)},n.id)),h=f(()=>["w-full cursor-text flex flex-wrap sm:text-sm rounded-md dark:text-white dark:bg-gray-900 border focus-within:border-transparent focus-within:ring-1 focus-within:outline-none",y.value?"pr-10 border-red-300 text-red-900 placeholder-red-300 focus-within:outline-none focus-within:ring-red-500 focus-within:border-red-500":"shadow-sm border-gray-300 dark:border-gray-600 focus-within:ring-indigo-500 focus-within:border-indigo-500",n.inputClass]),b=t=>M(r.value.filter(e=>e!=t));function x(e){document.activeElement===e.target&&null!=(e=v.value)&&e.focus()}const C=A();function L(){d.value=!0,C.value=!0}function V(){O(I()),C.value=!1,setTimeout(()=>{C.value||(d.value=!1)},200)}function M(e){e=n.string?e.join(","):e;t("update:modelValue",e)}function S(e){var t;"Backspace"==e.key&&0==p.value.length&&0<r.value.length&&b(r.value[r.value.length-1]),n.allowableValues&&0!=n.allowableValues.length&&("Escape"==e.code||"Tab"==e.code?d.value=!1:"Home"==e.code?(i.value=c.value[0],B()):"End"==e.code?(i.value=c.value[c.value.length-1],B()):"ArrowDown"==e.code?(d.value=!0,i.value?(t=c.value.indexOf(i.value),i.value=t+1<c.value.length?c.value[t+1]:c.value[0]):i.value=c.value[0],j()):"ArrowUp"==e.code?(i.value?(t=c.value.indexOf(i.value),i.value=0<=t-1?c.value[t-1]:c.value[c.value.length-1]):i.value=c.value[c.value.length-1],j()):"Enter"==e.code?i.value&&d.value?(O(i.value),e.preventDefault()):d.value=!1:d.value=0<c.value.length)}function I(){if(0==p.value.length)return"";let e=$o(p.value.trim(),",");return 0==(e=(e=","==e[0]?e.substring(1):e).trim()).length&&d.value&&0<c.value.length?i.value:e}function $(t){var e,l=I();0<l.length&&((e=n.delimiters.some(e=>e==t.key))&&t.preventDefault(),"Enter"==t.key||"NumpadEnter"==t.key||1==t.key.length&&e)&&O(l)}const F={behavior:"smooth",block:"nearest",inline:"nearest",scrollMode:"if-needed"};function B(){setTimeout(()=>{var e=pl(`#${n.id}-tag li.active`);e&&e.scrollIntoView(F)},0)}function j(){setTimeout(()=>{var e=pl(`#${n.id}-tag li.active`);e&&("scrollIntoViewIfNeeded"in e?e.scrollIntoViewIfNeeded(F):e.scrollIntoView(F))},0)}function O(e){var t;0!==e.length&&(-1==(t=Array.from(r.value)).indexOf(e)&&t.push(e),M(t),p.value="",d.value=!1)}function H(e){e=null==(e=e.clipboardData)?void 0:e.getData("Text");if(e){const t=new RegExp("\\n|\\t|"+n.delimiters.join("|")),l=Array.from(r.value);e.split(t).map(e=>e.trim()).forEach(e=>{-1==l.indexOf(e)&&l.push(e)}),M(l),p.value=""}}return(e,t)=>(a(),u("div",{class:w([e.$attrs.class]),id:l.id+"-tag",onmousemove:"cancelBlur=true"},[o(g)?(a(),u("label",{key:0,for:l.id,class:w("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(l.labelClass??""))},T(o(g)),11,Jd)):k("",!0),s("div",Xd,[s("input",{type:"hidden",id:l.id,name:l.id,value:o(r).join(",")},null,8,Yd),s("button",{class:w(o(h)),onClick:Ue(x,["prevent"]),onFocus:t[2]||(t[2]=e=>d.value=!0),tabindex:"-1"},[s("div",tc,[(a(!0),u(Te,null,Ie(o(r),t=>(a(),u("div",lc,[s("span",nc,[we(T(t)+" ",1),s("button",{type:"button",onClick:e=>b(t),class:"flex-shrink-0 ml-1 h-4 w-4 rounded-full inline-flex items-center justify-center text-indigo-400 dark:text-indigo-500 hover:bg-indigo-200 dark:hover:bg-indigo-800 hover:text-indigo-500 dark:hover:text-indigo-400 focus:outline-none focus:bg-indigo-500 focus:text-white dark:focus:text-black"},ac,8,sc)])]))),256)),s("div",ic,[kt(s("input",Me({ref_key:"txtInput",ref:v,type:o(m),role:"combobox","aria-controls":"options","aria-expanded":"false",autocomplete:"off",spellcheck:"false",name:l.id+"-txt",id:l.id+"-txt",class:"p-0 dark:bg-transparent rounded-md border-none focus:!border-none focus:!outline-none",style:`box-shadow:none !important;width:${p.value.length+1}ch`,"onUpdate:modelValue":t[0]||(t[0]=e=>p.value=e),"aria-invalid":null!=o(y),"aria-describedby":l.id+"-error",onKeydown:S,onKeypress:$,onPaste:Ue(H,["prevent","stop"]),onFocus:L,onBlur:V,onClick:t[1]||(t[1]=e=>d.value=!0)},o(dt)(e.$attrs,["class","required"])),null,16,rc),[[ao,p.value]])])])],42,ec),d.value&&o(c).length?(a(),u("ul",{key:0,class:"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white dark:bg-black py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm",onKeydown:S,id:l.id+"-options",role:"listbox"},[(a(!0),u(Te,null,Ie(o(c),l=>(a(),u("li",{class:w([l===i.value?"active bg-indigo-600 text-white":"text-gray-900 dark:text-gray-100","relative cursor-default select-none py-2 pl-3 pr-9"]),onMouseover:e=>{var t;t=l,i.value=t},onClick:e=>O(l),role:"option",tabindex:"-1"},[s("span",cc,T(l),1)],42,dc))),256))],40,uc)):k("",!0),o(y)?(a(),u("div",fc,vc)):k("",!0)]),o(y)?(a(),u("p",{key:1,class:"mt-2 text-sm text-red-500",id:l.id+"-error"},T(o(y)),9,hc)):l.help?(a(),u("p",{key:2,class:"mt-2 text-sm text-gray-500",id:l.id+"-description"},T(l.help),9,gc)):k("",!0)],10,Wd))}}),bc={class:"relative flex-grow mr-2 sm:mr-4"},wc=["for"],xc={class:"block mt-2"},kc={class:"sr-only"},$c=["multiple","name","id","placeholder","aria-invalid","aria-describedby"],Cc={key:0,class:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none"},_c=s("svg",{class:"h-5 w-5 text-red-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[s("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})],-1),Lc=[_c],Vc=["id"],Sc=["id"],Mc={key:0},Ac=["title"],Tc=["alt","src"],Fc={key:1,class:"mt-3"},Ic={class:"w-full"},Dc={class:"pr-6 align-bottom pb-2"},jc=["title"],Oc=["src","onError"],Pc=["href"],Bc={key:1,class:"overflow-hidden"},Rc={class:"align-top pb-2 whitespace-nowrap"},Ec={key:0,class:"text-gray-500 dark:text-gray-400 text-sm bg-white dark:bg-black"},Hc=ce({__name:"FileInput",props:{multiple:{type:Boolean},status:null,id:null,inputClass:null,label:null,labelClass:null,help:null,placeholder:null,modelValue:null,values:null,files:null},setup(l){var e;const t=l,n=A(null),{assetsPathResolver:r,fallbackPathResolver:i}=St(),d={},c=A(),v=A((null==(e=t.files)?void 0:e.map(p))||[]);function p(e){return e.filePath=r(e.filePath),e}t.values&&0<t.values.length&&(v.value=t.values.map(e=>{e=e.replace(/\\/g,"/");return{fileName:Co($t(e,"/"),"."),filePath:e,contentType:Kl(e)}}).map(p));const m=f(()=>t.label??He(st(t.id))),g=f(()=>t.placeholder??m.value);let y=Ne("ApiState",void 0);const h=f(()=>mt.call({responseStatus:t.status??(null==y?void 0:y.error.value)},t.id)),b=f(()=>["block w-full sm:text-sm rounded-md dark:text-white dark:bg-gray-900 file:mr-4 file:py-2 file:px-4 file:rounded-full file:border-0 file:text-sm file:font-semibold file:bg-violet-50 dark:file:bg-violet-900 file:text-violet-700 dark:file:text-violet-200 hover:file:bg-violet-100 dark:hover:file:bg-violet-800",h.value?"pr-10 border-red-300 text-red-900 placeholder-red-300 focus:outline-none focus:ring-red-500 focus:border-red-500":"text-slate-500 dark:text-slate-400",t.inputClass]),x=e=>{e=e.target;c.value="",v.value=Array.from(e.files||[]).map(e=>({fileName:e.name,filePath:un(e),contentLength:e.size,contentType:e.type||Kl(e.name)}))},C=()=>{var e;return null==(e=n.value)?void 0:e.click()},L=e=>null!=e&&(e.startsWith("data:")||e.startsWith("blob:")),V=f(()=>{var e;return 0<v.value.length?v.value[0].filePath:(e="string"==typeof t.modelValue?t.modelValue:t.values&&t.values[0])&&yt(r(e))||null}),M=e=>!e||e.startsWith("data:")||e.endsWith(".svg")?"":"rounded-full object-cover";function S(e){c.value=i(V.value)}return Rt(fs),(e,t)=>(a(),u("div",{class:w(["flex",l.multiple?"flex-col":"justify-between"])},[s("div",bc,[o(m)?(a(),u("label",{key:0,for:l.id,class:w("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(l.labelClass??""))},T(o(m)),11,wc)):k("",!0),s("div",xc,[s("span",kc,T(l.help??o(m)),1),s("input",Me({ref_key:"input",ref:n,type:"file",multiple:l.multiple,name:l.id,id:l.id,class:o(b),placeholder:o(g),"aria-invalid":null!=o(h),"aria-describedby":l.id+"-error"},e.$attrs,{onChange:x}),null,16,$c),o(h)?(a(),u("div",Cc,Lc)):k("",!0)]),o(h)?(a(),u("p",{key:1,class:"mt-2 text-sm text-red-500",id:l.id+"-error"},T(o(h)),9,Vc)):l.help?(a(),u("p",{key:2,class:"mt-2 text-sm text-gray-500",id:l.id+"-description"},T(l.help),9,Sc)):k("",!0)]),l.multiple?(a(),u("div",Fc,[s("table",Ic,[(a(!0),u(Te,null,Ie(v.value,t=>(a(),u("tr",null,[s("td",Dc,[s("div",{class:"flex w-full",title:L(t.filePath)?"":t.filePath},[s("img",{src:d[o(yt)(t.filePath)]||o(r)(o(yt)(t.filePath)),class:w(["mr-2 h-8 w-8",M(t.filePath)]),onError:e=>d[o(yt)(t.filePath)]=o(i)(o(yt)(t.filePath))},null,42,Oc),L(t.filePath)?(a(),u("span",Bc,T(t.fileName),1)):(a(),u("a",{key:0,href:o(r)(t.filePath||""),target:"_blank",class:"overflow-hidden"},T(t.fileName),9,Pc))],8,jc)]),s("td",Rc,[t.contentLength&&0<t.contentLength?(a(),u("span",Ec,T(o(cn)(t.contentLength)),1)):k("",!0)])]))),256))])])):(a(),u("div",Mc,[o(V)?(a(),u("div",{key:0,class:"shrink-0 cursor-pointer",title:L(o(V))?"":o(V)},[s("img",{onClick:C,class:w(["h-16 w-16",M(o(V))]),alt:"Current "+(o(m)??""),src:c.value||o(r)(o(V)),onError:S},null,42,Tc)],8,Ac)):k("",!0)]))],2))}}),zc=["id"],Nc=["for"],Uc={class:"relative mt-1"},qc=["id","placeholder"],Qc=s("svg",{class:"h-5 w-5 text-gray-400 dark:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[s("path",{"fill-rule":"evenodd",d:"M10 3a.75.75 0 01.55.24l3.25 3.5a.75.75 0 11-1.1 1.02L10 4.852 7.3 7.76a.75.75 0 01-1.1-1.02l3.25-3.5A.75.75 0 0110 3zm-3.76 9.2a.75.75 0 011.06.04l2.7 2.908 2.7-2.908a.75.75 0 111.1 1.02l-3.25 3.5a.75.75 0 01-1.1 0l-3.25-3.5a.75.75 0 01.04-1.06z","clip-rule":"evenodd"})],-1),Kc=[Qc],Zc=["id"],Gc=["onMouseover","onClick"],Wc=s("svg",{class:"h-5 w-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[s("path",{"fill-rule":"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z","clip-rule":"evenodd"})],-1),Jc=[Wc],Xc={key:2,class:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none",tabindex:"-1"},Yc=s("svg",{class:"h-5 w-5 text-red-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[s("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})],-1),e0=[Yc],t0=["id"],l0=["id"],n0=ce({__name:"Autocomplete",props:{status:null,id:null,type:null,label:null,help:null,placeholder:null,multiple:{type:Boolean,default:!1},required:{type:Boolean},options:{default:()=>[]},modelValue:null,match:null,viewCount:{default:100},pageSize:{default:8}},emits:["update:modelValue"],setup(l,{expose:e,emit:n}){const r=l,i=A(!1);function d(e){return Array.isArray(r.modelValue)&&0<=r.modelValue.indexOf(e)}e({toggle:B});const c=f(()=>r.label??He(st(r.id)));let t=Ne("ApiState",void 0);const v=f(()=>mt.call({responseStatus:r.status??(null==t?void 0:t.error.value)},r.id)),p=f(()=>[nt.base,v.value?nt.invalid:nt.valid]),m=A(null),g=A(""),y=A(null),h=A(r.viewCount),b=A([]),x=f(()=>g.value?r.options.filter(e=>r.match(e,g.value)).slice(0,h.value):r.options),C=["Tab","Escape","ArrowDown","ArrowUp","Enter","PageUp","PageDown","Home","End"];const L=[",",`
`,"\t"];function V(t){var l=null==(t=t.clipboardData)?void 0:t.getData("Text");if(l){t=L.some(e=>l.includes(e));if(r.multiple&&t){if(t){t=new RegExp("\\r|\\n|\\t|,"),t=l.split(t).filter(e=>e.trim()).map(t=>r.options.find(e=>r.match(e,t))).filter(e=>!!e);if(0<t.length){g.value="",i.value=!1,y.value=null;let e=Array.from(r.modelValue||[]);t.forEach(t=>{d(t)?e=e.filter(e=>e!=t):e.push(t)}),n("update:modelValue",e),cl()}}}else{t=r.options.filter(e=>r.match(e,l));1==t.length&&(O(t[0]),i.value=!1,cl())}}}function M(e){C.indexOf(e.code)||j()}function S(e){var t;e.shiftKey||e.ctrlKey||e.altKey||(i.value?"Escape"==e.code?i.value&&(e.stopPropagation(),i.value=!1):"Tab"==e.code?i.value=!1:"Home"==e.code?(y.value=b.value[0],$()):"End"==e.code?(y.value=b.value[b.value.length-1],$()):"ArrowDown"==e.code?(y.value?(t=b.value.indexOf(y.value),y.value=t+1<b.value.length?b.value[t+1]:b.value[0]):y.value=b.value[0],F()):"ArrowUp"==e.code?(y.value?(t=b.value.indexOf(y.value),y.value=0<=t-1?b.value[t-1]:b.value[b.value.length-1]):y.value=b.value[b.value.length-1],F()):"Enter"==e.code&&(y.value?(O(y.value),r.multiple||(e.preventDefault(),cl())):i.value=!1):"ArrowDown"==e.code&&(i.value=!0,y.value=b.value[0]))}const I={behavior:"smooth",block:"nearest",inline:"nearest",scrollMode:"if-needed"};function $(){setTimeout(()=>{var e=pl(`#${r.id}-autocomplete li.active`);e&&e.scrollIntoView(I)},0)}function F(){setTimeout(()=>{var e=pl(`#${r.id}-autocomplete li.active`);e&&("scrollIntoViewIfNeeded"in e?e.scrollIntoViewIfNeeded(I):e.scrollIntoView(I))},0)}function B(e){(i.value=e)&&(j(),null!=(e=m.value))&&e.focus()}function j(){i.value=!0,H()}function O(t){if(g.value="",i.value=!1,r.multiple){let e=Array.from(r.modelValue||[]);d(t)?e=e.filter(e=>e!=t):e.push(t),y.value=null,n("update:modelValue",e)}else{let e=t;r.modelValue==t&&(e=null),n("update:modelValue",e)}}function H(){b.value=x.value}return Lt(g,H),(e,t)=>(a(),u("div",{id:l.id+"-autocomplete"},[o(c)?(a(),u("label",{key:0,for:l.id+"-text",class:"block text-sm font-medium text-gray-700 dark:text-gray-300"},T(o(c)),9,Nc)):k("",!0),s("div",Uc,[kt(s("input",Me({ref_key:"txtInput",ref:m,id:l.id+"-text",type:"text",role:"combobox","aria-controls":"options","aria-expanded":"false",autocomplete:"off",spellcheck:"false","onUpdate:modelValue":t[0]||(t[0]=e=>g.value=e),class:o(p),placeholder:l.multiple||!l.modelValue?l.placeholder:"",onFocus:j,onKeydown:S,onKeyup:M,onClick:j,onPaste:V,required:!1},e.$attrs),null,16,qc),[[io,g.value]]),s("button",{type:"button",onClick:t[1]||(t[1]=e=>B(!i.value)),class:"absolute inset-y-0 right-0 flex items-center rounded-r-md px-2 focus:outline-none",tabindex:"-1"},Kc),i.value?(a(),u("ul",{key:0,class:"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white dark:bg-black py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm",onKeydown:S,id:l.id+"-options",role:"listbox"},[(a(!0),u(Te,null,Ie(b.value,l=>(a(),u("li",{class:w([l===y.value?"active bg-indigo-600 text-white":"text-gray-900 dark:text-gray-100","relative cursor-default select-none py-2 pl-3 pr-9"]),onMouseover:e=>{return t=l,y.value=t,void(b.value.indexOf(t)>Math.floor(.9*h.value)&&(h.value+=r.viewCount,H()));var t},onClick:e=>O(l),role:"option",tabindex:"-1"},[Z(e.$slots,"item",jt(gl(l))),d(l)?(a(),u("span",{key:0,class:w(["absolute inset-y-0 right-0 flex items-center pr-4",l===y.value?"text-white":"text-indigo-600"])},Jc,2)):k("",!0)],42,Gc))),256))],40,Zc)):!l.multiple&&l.modelValue?(a(),u("div",{key:1,onKeydown:S,onClick:t[2]||(t[2]=e=>B(!i.value)),class:"h-8 -mt-8 ml-3 pt-0.5"},[Z(e.$slots,"item",jt(gl(l.modelValue)))],32)):k("",!0),o(v)?(a(),u("div",Xc,e0)):k("",!0)]),o(v)?(a(),u("p",{key:1,class:"mt-2 text-sm text-red-500",id:l.id+"-error"},T(o(v)),9,t0)):l.help?(a(),u("p",{key:2,class:"mt-2 text-sm text-gray-500",id:l.id+"-description"},T(l.help),9,l0)):k("",!0)],8,zc))}}),s0=["id","name","value"],o0={class:"block truncate"},a0=ce({__name:"Combobox",props:{id:null,modelValue:null,multiple:{type:Boolean},options:null,values:null,entries:null},emits:["update:modelValue"],setup(n,{expose:e,emit:t}){const l=n;function r(e){t("update:modelValue",e)}e({toggle(e){var t;null!=(t=d.value)&&t.toggle(e)}});const i=f(()=>null!=l.multiple?l.multiple:Array.isArray(l.modelValue)),d=A();function c(e,t){return!t||e.value.toLowerCase().includes(t.toLowerCase())}const v=f(()=>l.entries||(l.values?l.values.map(e=>({key:e,value:e})):l.options?Object.keys(l.options).map(e=>({key:e,value:l.options[e]})):[])),p=A(i.value?[]:null);tt(function(){let t=l.modelValue&&"object"==typeof l.modelValue?l.modelValue.key:l.modelValue;null==t||""===t?p.value=i.value?[]:null:"string"==typeof t?p.value=v.value.find(e=>e.key===t)||null:Array.isArray(t)&&(p.value=v.value.filter(e=>t.includes(e.key)))});const m=f(()=>null==p.value?"":Array.isArray(p.value)?p.value.map(e=>encodeURIComponent(e.key)).join(","):p.value.key);return(e,t)=>{var l=X("Autocomplete");return a(),u(Te,null,[s("input",{type:"hidden",id:n.id,name:n.id,value:o(m)},null,8,s0),$e(l,Me({ref_key:"input",ref:d,id:n.id,options:o(v),match:c,multiple:o(i)},e.$attrs,{modelValue:p.value,"onUpdate:modelValue":[t[0]||(t[0]=e=>p.value=e),r]}),{item:ke(({value:e})=>[s("span",o0,T(e),1)]),_:1},16,["id","options","multiple","modelValue"])],64)}}}),i0=ce({__name:"DynamicInput",props:{input:null,modelValue:null,api:null},emits:["update:modelValue"],setup(p,{emit:e}){const l=p,m=f(()=>l.input.type||"text"),t="ignore,css,options,meta,allowableValues,allowableEntries,op,prop,type,id,name".split(","),g=f(()=>dt(l.input,t)),y=A(qe(l.modelValue[l.input.id],e=>"file"===l.input.type?null:"date"===l.input.type&&e instanceof Date?$l(e):"time"===l.input.type?ls(e):e)),h=(Lt(y,()=>{l.modelValue[l.input.id]=y.value,e("update:modelValue",l.modelValue)}),f(()=>{var e=l.modelValue[l.input.id];if("file"!==l.input.type||!e)return[];if("string"==typeof e)return[{filePath:e,fileName:$t(e,"/")}];if(!Array.isArray(e)&&"object"==typeof e)return e;if(Array.isArray(e)){const t=[];return e.forEach(e=>{"string"==typeof e?t.push({filePath:e,fileName:$t(e,"/")}):"object"==typeof e&&t.push(e)}),t}}));return(e,t)=>{var l,s=X("SelectInput"),n=X("CheckboxInput"),r=X("TagInput"),i=X("Combobox"),u=X("FileInput"),d=X("TextareaInput"),c=X("MarkdownInput"),v=X("TextInput");return o(ne).component(o(m))?(a(),se(Jn(o(ne).component(o(m))),Me({key:0,id:p.input.id,modelValue:y.value,"onUpdate:modelValue":t[0]||(t[0]=e=>y.value=e),status:null==(l=p.api)?void 0:l.error,"input-class":null==(l=p.input.css)?void 0:l.input,"label-class":null==(l=p.input.css)?void 0:l.label},o(g)),null,16,["id","modelValue","status","input-class","label-class"])):"select"==o(m)?(a(),se(s,Me({key:1,id:p.input.id,modelValue:y.value,"onUpdate:modelValue":t[1]||(t[1]=e=>y.value=e),status:null==(l=p.api)?void 0:l.error,"input-class":null==(s=p.input.css)?void 0:s.input,"label-class":null==(l=p.input.css)?void 0:l.label,entries:p.input.allowableEntries,values:p.input.allowableValues},o(g)),null,16,["id","modelValue","status","input-class","label-class","entries","values"])):"checkbox"==o(m)?(a(),se(n,Me({key:2,id:p.input.id,modelValue:y.value,"onUpdate:modelValue":t[2]||(t[2]=e=>y.value=e),status:null==(s=p.api)?void 0:s.error,"input-class":null==(l=p.input.css)?void 0:l.input,"label-class":null==(n=p.input.css)?void 0:n.label},o(g)),null,16,["id","modelValue","status","input-class","label-class"])):"tag"==o(m)?(a(),se(r,Me({key:3,id:p.input.id,modelValue:y.value,"onUpdate:modelValue":t[3]||(t[3]=e=>y.value=e),status:null==(s=p.api)?void 0:s.error,"input-class":null==(l=p.input.css)?void 0:l.input,"label-class":null==(n=p.input.css)?void 0:n.label,allowableValues:p.input.allowableValues,string:"String"==(null==(r=p.input.prop)?void 0:r.type)},o(g)),null,16,["id","modelValue","status","input-class","label-class","allowableValues","string"])):"combobox"==o(m)?(a(),se(i,Me({key:4,id:p.input.id,modelValue:y.value,"onUpdate:modelValue":t[4]||(t[4]=e=>y.value=e),status:null==(s=p.api)?void 0:s.error,"input-class":null==(l=p.input.css)?void 0:l.input,"label-class":null==(n=p.input.css)?void 0:n.label,entries:p.input.allowableEntries,values:p.input.allowableValues},o(g)),null,16,["id","modelValue","status","input-class","label-class","entries","values"])):"file"==o(m)?(a(),se(u,Me({key:5,id:p.input.id,status:null==(r=p.api)?void 0:r.error,modelValue:y.value,"onUpdate:modelValue":t[5]||(t[5]=e=>y.value=e),"input-class":null==(i=p.input.css)?void 0:i.input,"label-class":null==(s=p.input.css)?void 0:s.label,files:o(h)},o(g)),null,16,["id","status","modelValue","input-class","label-class","files"])):"textarea"==o(m)?(a(),se(d,Me({key:6,id:p.input.id,modelValue:y.value,"onUpdate:modelValue":t[6]||(t[6]=e=>y.value=e),status:null==(l=p.api)?void 0:l.error,"input-class":null==(n=p.input.css)?void 0:n.input,"label-class":null==(u=p.input.css)?void 0:u.label},o(g)),null,16,["id","modelValue","status","input-class","label-class"])):"MarkdownInput"==o(m)?(a(),se(c,Me({key:7,id:p.input.id,modelValue:y.value,"onUpdate:modelValue":t[7]||(t[7]=e=>y.value=e),status:null==(r=p.api)?void 0:r.error,"input-class":null==(i=p.input.css)?void 0:i.input,"label-class":null==(s=p.input.css)?void 0:s.label},o(g)),null,16,["id","modelValue","status","input-class","label-class"])):(a(),se(v,Me({key:8,type:o(m),id:p.input.id,modelValue:y.value,"onUpdate:modelValue":t[8]||(t[8]=e=>y.value=e),status:null==(d=p.api)?void 0:d.error,"input-class":null==(l=p.input.css)?void 0:l.input,"label-class":null==(n=p.input.css)?void 0:n.label},o(g)),null,16,["type","id","modelValue","status","input-class","label-class"]))}}}),r0={class:"lookup-field"},u0=["name","value"],d0={key:0,class:"flex justify-between"},c0=["for"],f0={key:0,class:"flex items-center"},m0={class:"text-sm text-gray-500 dark:text-gray-400 pr-1"},v0=s("span",{class:"sr-only"},"Clear",-1),h0=s("svg",{class:"h-4 w-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true"},[s("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1),g0=[v0,h0],p0={key:1,class:"mt-1 relative"},y0={class:"w-full inline-flex truncate"},b0={class:"text-blue-700 dark:text-blue-300 flex cursor-pointer"},w0=s("span",{class:"absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none"},[s("svg",{class:"h-5 w-5 text-gray-400 dark:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[s("path",{"fill-rule":"evenodd",d:"M10 3a1 1 0 01.707.293l3 3a1 1 0 01-1.414 1.414L10 5.414 7.707 7.707a1 1 0 01-1.414-1.414l3-3A1 1 0 0110 3zm-3.707 9.293a1 1 0 011.414 0L10 14.586l2.293-2.293a1 1 0 011.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z","clip-rule":"evenodd"})])],-1),x0=["id"],k0=["id"],$0=ce({__name:"LookupInput",props:{id:null,status:null,input:null,metadataType:null,modelValue:null,label:null,labelClass:null,help:null},emits:["update:modelValue"],setup(r,{emit:i}){const d=r,t=St()["config"],n=at()["metadataApi"],c=f(()=>d.id||d.input.id),v=f(()=>d.label??He(st(c.value)));let e=Ne("ApiState",void 0);const p=Ne("client"),m=f(()=>mt.call({responseStatus:d.status??(null==e?void 0:e.error.value)},c.value)),g=A(""),y=A(""),h=f(()=>ye(d.modelValue,c.value)),b=f(()=>et(d.metadataType).find(e=>e.name.toLowerCase()==c.value.toLowerCase())),x=f(()=>{var e;return(null==(e=ot(null==(e=null==(e=b.value)?void 0:e.ref)?void 0:e.model))?void 0:e.icon)||t.value.tableIcon});let C;function L(){d.modelValue[c.value]=null,g.value=""}return tt(async()=>{C=Ne("ModalProvider",void 0);var t,l=d.modelValue;d.modelValue[c.value]||(d.modelValue[c.value]=null);const a=b.value,s=null==a?void 0:a.ref;if(s){g.value="";let e=null==s.selfId?ye(l,a.name):ye(l,s.selfId);null==(e=Zt(e)?ye(l,s.refId):e)||null==(null==(t=n.value)?void 0:t.operations.find(e=>{return(null==(e=e.dataModel)?void 0:e.name)==s.model}))||Zt(t=ye(l,a.name))||(g.value=""+t,y.value=a.name,null!=s.refLabel&&(null==(t=et(d.metadataType).find(e=>e.type==s.model))&&console.warn(`Could not find ${s.model} Property on `+d.metadataType.name),null!=(l=null!=t?ye(l,t.name):null)?(t=ye(l,s.refLabel))&&(g.value=""+t,Ft.setValue(s.model,e,s.refLabel,t)):(t=1==(null==(l=a.attributes)?void 0:l.some(e=>"Computed"==e.name)),l=await Ft.getOrFetchValue(p,n.value,s.model,s.refId,s.refLabel,t,e),g.value=l||s.model+": "+g.value)))}else console.warn(`No RefInfo for property '${c.value}'`)}),(e,t)=>{var l,n=X("Icon");return a(),u("div",r0,[s("input",{type:"hidden",name:o(c),value:o(h)},null,8,u0),o(v)?(a(),u("div",d0,[s("label",{for:o(c),class:w("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(r.labelClass??""))},T(o(v)),11,c0),o(h)?(a(),u("div",f0,[s("span",m0,T(o(h)),1),s("button",{onClick:L,type:"button",title:"clear",class:"mr-1 rounded-md text-gray-400 dark:text-gray-500 hover:text-gray-500 dark:hover:text-gray-400 focus:outline-none focus:ring-2 focus:ring-indigo-500 dark:ring-offset-black"},g0)])):k("",!0)])):k("",!0),null!=(l=o(b))&&l.ref?(a(),u("div",p0,[s("button",{type:"button",class:"lookup flex relative w-full bg-white dark:bg-black border border-gray-300 dark:border-gray-700 rounded-md shadow-sm pl-3 pr-10 py-2 text-left focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm",onClick:t[0]||(t[0]=e=>{var l;(l=o(b).ref)&&(null==C?console.warn("No ModalProvider required by LookupInput"):C.openModal({name:"ModalLookup",ref:l},e=>{var t;console.debug("openModal",g.value," -> ",e,Ft.setRefValue(l,e),l),e&&(t=ye(e,l.refId),g.value=Ft.setRefValue(l,e)||t,(e=o(d.modelValue))[c.value]=t,i("update:modelValue",e))}))}),"aria-haspopup":"listbox","aria-expanded":"true","aria-labelledby":"listbox-label"},[s("span",y0,[s("span",b0,[$e(n,{class:"mr-1 w-5 h-5",image:o(x)},null,8,["image"]),s("span",null,T(g.value),1)])]),w0])])):k("",!0),o(m)?(a(),u("p",{key:2,class:"mt-2 text-sm text-red-500",id:o(c)+"-error"},T(o(m)),9,x0)):r.help?(a(),u("p",{key:3,class:"mt-2 text-sm text-gray-500",id:o(c)+"-description"},T(r.help),9,k0)):k("",!0)])}}}),C0=ce({__name:"AutoFormFields",props:{modelValue:null,type:null,api:null,formLayout:null,configureField:null,configureFormLayout:null,hideSummary:{type:Boolean},flexClass:{default:"flex flex-1 flex-col justify-between"},divideClass:{default:"divide-y divide-gray-200 px-4 sm:px-6"},spaceClass:{default:"space-y-6 pt-6 pb-5"},fieldsetClass:{default:"grid grid-cols-12 gap-6"}},emits:["update:modelValue"],setup(d,{expose:e,emit:l}){const r=d;function n(){var e=Be();null!=(e=null==e?void 0:e.proxy)&&e.$forceUpdate()}function c(e,t){r.modelValue[e]=t,l("update:modelValue",r.modelValue),n()}e({forceUpdate:n,props:r,updateValue:c});const{metadataApi:t,apiOf:i,typeOf:v,typeOfRef:p,createFormLayout:m}=at(),g=f(()=>r.type||Et(r.modelValue)),y=f(()=>v(g.value)),h=f(()=>{var e;return p(null==(e=null==(e=t.value)?void 0:e.operations.find(e=>e.request.name==g.value))?void 0:e.dataModel)||y.value}),b=f(()=>{var e,t=y.value;if(!t){if(r.formLayout)return e=r.formLayout.map(e=>{var t={name:e.id,type:ya(e.type)},t=Object.assign({prop:t},e);return r.configureField&&r.configureField(t),t}),r.configureFormLayout&&r.configureFormLayout(e),e;throw new Error(`MetadataType for ${g.value} not found`)}const a=et(t),s=h.value,l=r.formLayout||m(t),n=[],o=i(t.name);return l.forEach(t=>{var e,l=a.find(e=>e.name==t.name);t.ignore||(e=(null==(e=null==s?void 0:s.properties)?void 0:e.find(e=>{return e.name.toLowerCase()==(null==(e=t.name)?void 0:e.toLowerCase())}))??l,l=Object.assign({prop:e,op:o},t),r.configureField&&r.configureField(l),n.push(l))}),r.configureFormLayout&&r.configureFormLayout(n),n}),x=f(()=>b.value.filter(e=>"hidden"!=e.type).map(e=>e.id));return(l,n)=>{var e;const t=X("ErrorSummary"),r=X("LookupInput"),i=X("DynamicInput");return a(),u(Te,null,[d.hideSummary?k("",!0):(a(),se(t,{key:0,status:null==(e=d.api)?void 0:e.error,except:o(x)},null,8,["status","except"])),s("div",{class:w(d.flexClass)},[s("div",{class:w(d.divideClass)},[s("div",{class:w(d.spaceClass)},[s("fieldset",{class:w(d.fieldsetClass)},[(a(!0),u(Te,null,Ie(o(b),t=>{var e;return a(),u("div",{key:t.id,class:w(["w-full",(null==(e=t.css)?void 0:e.field)??("textarea"==t.type?"col-span-12":"col-span-12 xl:col-span-6"+("checkbox"==t.type?" flex items-center":"")),"hidden"==t.type?"hidden":""])},[null==(null==(e=t.prop)?void 0:e.ref)||"file"==t.type||t.prop.isPrimaryKey?(a(),se(i,{key:1,input:t,modelValue:d.modelValue,"onUpdate:modelValue":n[0]||(n[0]=e=>l.$emit("update:modelValue",e)),api:d.api},null,8,["input","modelValue","api"])):(a(),se(r,{key:0,metadataType:o(h),input:t,modelValue:d.modelValue,"onUpdate:modelValue":e=>{c(t.id,ye(e,t.id))},status:null==(e=d.api)?void 0:e.error},null,8,["metadataType","input","modelValue","onUpdate:modelValue","status"]))],2)}),128))],2)],2)],2)],2)],64)}}});function Tl(){const s=A(!1),n=A(),o=A(),r=Ne("client");function i({message:e,errorCode:t,fieldName:l,errors:a}){return t=t||"Exception",a=a||[],n.value=new Bl(l?{errorCode:t,message:e,errors:[new Un({fieldName:l,errorCode:t,message:e})]}:{errorCode:t,message:e,errors:a})}var e={setError:i,addFieldError:function({fieldName:t,message:e,errorCode:l}){var a;l=l||"Exception",n.value?((a=new Bl(n.value)).errors=[...(a.errors||[]).filter(e=>{return(null==(e=e.fieldName)?void 0:e.toLowerCase())!==(null==t?void 0:t.toLowerCase())}),new Un({fieldName:t,message:e,errorCode:l})],n.value=a):i({fieldName:t,message:e,errorCode:l})},loading:s,error:n,api:async function(e,t,l){return s.value=!0,e=await r.api(Tt(e),t,l),s.value=!1,o.value=e.response,n.value=e.error,e},apiVoid:async function(e,t,l){return s.value=!0,e=await r.apiVoid(Tt(e),t,l),s.value=!1,o.value=e.response,n.value=e.error,e},apiForm:async function(e,t,l,a){return s.value=!0,e=await r.apiForm(Tt(e),t,l,a),s.value=!1,o.value=e.response,n.value=e.error,e},apiFormVoid:async function(e,t,l,a){return s.value=!0,e=await r.apiFormVoid(Tt(e),t,l,a),s.value=!1,o.value=e.response,n.value=e.error,e},swr:async function(e,t,l,a){return os(r,e,t,l,a)},swrEffect:function(l,a){const s=A(new Je),n=as(async e=>{s.value=await r.api(e)},null==a?void 0:a.delayMs);return hl(async()=>{var e=l(),t=on(_l(e));t&&(s.value=new Je({response:t})),0===(null==a?void 0:a.delayMs)?s.value=await r.api(e):n(e)}),(async()=>s.value=await r.api(l(),null==a?void 0:a.args,null==a?void 0:a.method))(),s},unRefs:Tt,setRef:ns};return Xt("ApiState",e),e}const _0={key:0},L0={class:"text-red-700"},V0=s("b",null,"type",-1),S0={key:0},M0={key:2},A0=["innerHTML"],T0=s("input",{type:"submit",class:"hidden"},null,-1),F0={class:"flex justify-end"},I0=s("div",null,null,-1),D0={key:2,class:"relative z-10","aria-labelledby":"slide-over-title",role:"dialog","aria-modal":"true"},j0=s("div",{class:"fixed inset-0"},null,-1),O0={class:"fixed inset-0 overflow-hidden"},P0={class:"flex min-h-0 flex-1 flex-col overflow-auto"},B0={class:"flex-1"},R0={class:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},E0={class:"flex items-start justify-between space-x-3"},H0={class:"space-y-1"},z0={key:0},N0={key:2},U0=["innerHTML"],q0={class:"flex h-7 items-center"},Q0={class:"flex justify-end"},K0=ce({__name:"AutoForm",props:{type:null,modelValue:null,heading:null,subHeading:null,showLoading:{type:Boolean,default:!0},jsconfig:{default:"eccn,edv"},formStyle:{default:"card"},configureField:null,configureFormLayout:null,panelClass:null,bodyClass:null,formClass:null,innerFormClass:null,headerClass:{default:"p-6"},buttonsClass:null,headingClass:null,subHeadingClass:null,submitLabel:{default:"Submit"},allowSubmit:null},emits:["success","error","update:modelValue","done"],setup(p,{expose:e,emit:r}){const i=p,m=A(),g=A(1),y=A();function t(){g.value++,B.value=F();var e=Be();null!=(e=null==e?void 0:e.proxy)&&e.$forceUpdate()}e({forceUpdate:t,props:i,setModel:async function(e){Object.assign(B.value,e),t(),await xt(()=>null)},formFields:m,submit:async function(){D(y.value)},close:P}),Xt("ModalProvider",{openModal:function(e,t){h.value=e,l.value=t}});const h=A(),l=A();async function b(e){l.value&&l.value(e),h.value=void 0,l.value=void 0}const d=Tl(),n=is()["getTypeName"],{typeOf:c,createDto:v}=at(),x=A(new Je),C=f(()=>i.panelClass||Ze.panelClass(i.formStyle)),L=f(()=>i.formClass||"card"==i.formStyle?"shadow sm:rounded-md":It.formClass),V=f(()=>i.headingClass||Ze.headingClass(i.formStyle)),M=f(()=>i.subHeadingClass||Ze.subHeadingClass(i.formStyle)),S=f(()=>("string"==typeof i.buttonsClass?i:Ze).buttonsClass),I=f(()=>{var e;return i.type?n(i.type):null!=(e=i.modelValue)&&e.getTypeName?i.modelValue.getTypeName():null}),$=f(()=>c(I.value)),F=()=>i.modelValue||H(),B=A(F()),j=f(()=>d.loading.value),O=f(()=>{var e;return i.heading||(null==(e=c(I.value))?void 0:e.description)||He(I.value)});function H(){return"string"==typeof i.type?v(i.type):i.type?new i.type:i.modelValue}async function D(e){var t,l,a,s,n;e&&"FORM"==e.tagName?(t=H(),n=qe(null==t?void 0:t.getMethod,e=>"function"==typeof e?e():null)||"POST",l=null==qe(null==t?void 0:t.createResponse,e=>"function"==typeof e?e():null),a=i.jsconfig,ln.hasRequestBody(n)?(n=new t.constructor,s=new FormData(e),console.debug("AutoForm.submitForm",n,s),x.value=l?await d.apiFormVoid(n,s,{jsconfig:a}):await d.apiForm(n,s,{jsconfig:a})):(n=new t.constructor(B.value),console.debug("AutoForm.submit",n),x.value=l?await d.apiVoid(n,{jsconfig:a}):await d.api(n,{jsconfig:a})),x.value.succeeded?(r("success",x.value.response),P()):r("error",x.value.error)):console.error("Not a valid form",e)}function E(e){r("update:modelValue",e)}function z(){r("done")}const _=A(!1),R=A(""),N={entering:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-full",to:"translate-x-0"},leaving:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-0",to:"translate-x-full"}};function P(){"slideOver"==i.formStyle?_.value=!1:z()}Lt(_,()=>{Ct(N,R,_.value),_.value||setTimeout(z,700)}),_.value=!0;const U=e=>{"Escape"===e.key&&P()};return tt(()=>window.addEventListener("keydown",U)),Rt(()=>window.removeEventListener("keydown",U)),(t,e)=>{var l;const n=X("AutoFormFields"),r=X("FormLoading"),i=X("PrimaryButton"),d=X("CloseButton"),c=X("SecondaryButton"),v=X("ModalLookup");return a(),u("div",null,[o($)?"card"==p.formStyle?(a(),u("div",{key:1,class:w(o(C))},[s("form",{ref_key:"elForm",ref:y,onSubmit:e[0]||(e[0]=Ue(e=>D(e.target),["prevent"])),autocomplete:"off",class:w(p.innerFormClass)},[s("div",{class:w(p.bodyClass)},[s("div",{class:w(p.headerClass)},[t.$slots.heading?(a(),u("div",S0,[Z(t.$slots,"heading")])):(a(),u("h3",{key:1,class:w(o(V))},T(o(O)),3)),t.$slots.subheading?(a(),u("div",M0,[Z(t.$slots,"subheading")])):p.subHeading?(a(),u("p",{key:3,class:w(o(M))},T(p.subHeading),3)):null!=(l=o($))&&l.notes?(a(),u("p",{key:4,class:w(["notes",o(M)]),innerHTML:null==(l=o($))?void 0:l.notes},null,10,A0)):k("",!0)],2),Z(t.$slots,"header",{instance:null==(l=Be())?void 0:l.exposed,model:B.value}),T0,(a(),se(n,{ref_key:"formFields",ref:m,key:g.value,type:p.type,modelValue:B.value,"onUpdate:modelValue":E,api:x.value,configureField:p.configureField,configureFormLayout:p.configureFormLayout},null,8,["type","modelValue","api","configureField","configureFormLayout"])),Z(t.$slots,"footer",{instance:null==(l=Be())?void 0:l.exposed,model:B.value})],2),Z(t.$slots,"buttons",{},()=>{var e;return[s("div",{class:w(o(S))},[s("div",null,[Z(t.$slots,"leftbuttons",{instance:null==(e=Be())?void 0:e.exposed,model:B.value})]),s("div",null,[p.showLoading&&o(j)?(a(),se(r,{key:0})):k("",!0)]),s("div",F0,[I0,$e(i,{disabled:!!p.allowSubmit&&!p.allowSubmit(B.value)},{default:ke(()=>[we(T(p.submitLabel),1)]),_:1},8,["disabled"]),Z(t.$slots,"rightbuttons",{instance:null==(e=Be())?void 0:e.exposed,model:B.value})])],2)]})],34)],2)):(a(),u("div",D0,[j0,s("div",O0,[s("div",{onMousedown:P,class:"absolute inset-0 overflow-hidden"},[s("div",{onMousedown:e[2]||(e[2]=Ue(()=>{},["stop"])),class:"pointer-events-none fixed inset-y-0 right-0 flex pl-10"},[s("div",{class:w(["pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",R.value])},[s("form",{ref_key:"elForm",ref:y,class:w(o(L)),onSubmit:e[1]||(e[1]=Ue(e=>D(e.target),["prevent"]))},[s("div",P0,[s("div",B0,[s("div",R0,[s("div",E0,[s("div",H0,[t.$slots.heading?(a(),u("div",z0,[Z(t.$slots,"heading")])):(a(),u("h3",{key:1,class:w(o(V))},T(o(O)),3)),t.$slots.subheading?(a(),u("div",N0,[Z(t.$slots,"subheading")])):p.subHeading?(a(),u("p",{key:3,class:w(o(M))},T(p.subHeading),3)):null!=(l=o($))&&l.notes?(a(),u("p",{key:4,class:w(["notes",o(M)]),innerHTML:null==(e=o($))?void 0:e.notes},null,10,U0)):k("",!0)]),s("div",q0,[$e(d,{"button-class":"bg-gray-50 dark:bg-gray-900",onClose:P})])])]),Z(t.$slots,"header",{instance:null==(l=Be())?void 0:l.exposed,model:B.value}),(a(),se(n,{ref_key:"formFields",ref:m,key:g.value,type:p.type,modelValue:B.value,"onUpdate:modelValue":E,api:x.value,configureField:p.configureField,configureFormLayout:p.configureFormLayout},null,8,["type","modelValue","api","configureField","configureFormLayout"])),Z(t.$slots,"footer",{instance:null==(e=Be())?void 0:e.exposed,model:B.value})])]),s("div",{class:w(o(S))},[s("div",null,[Z(t.$slots,"leftbuttons",{instance:null==(l=Be())?void 0:l.exposed,model:B.value})]),s("div",null,[p.showLoading&&o(j)?(a(),se(r,{key:0})):k("",!0)]),s("div",Q0,[$e(c,{onClick:P,disabled:o(j)},{default:ke(()=>[we("Cancel")]),_:1},8,["disabled"]),$e(i,{class:"ml-4",disabled:!!p.allowSubmit&&!p.allowSubmit(B.value)},{default:ke(()=>[we(T(p.submitLabel),1)]),_:1},8,["disabled"]),Z(t.$slots,"rightbuttons",{instance:null==(e=Be())?void 0:e.exposed,model:B.value})])],2)],34)],2)],32)],32)])])):(a(),u("div",_0,[s("p",L0,[we("Could not create form for unknown "),V0,we(" "+T(o(I)),1)])])),"ModalLookup"==(null==(l=h.value)?void 0:l.name)&&h.value.ref?(a(),se(v,{key:3,"ref-info":h.value.ref,onDone:b},null,8,["ref-info"])):k("",!0)])}}}),Z0={key:0},G0={class:"text-red-700"},W0=s("b",null,"type",-1),J0=["onSubmit"],X0={key:0},Y0={key:2},ef=["innerHTML"],tf={class:"flex justify-end"},lf={key:2,class:"relative z-10","aria-labelledby":"slide-over-title",role:"dialog","aria-modal":"true"},nf=s("div",{class:"fixed inset-0"},null,-1),sf={class:"fixed inset-0 overflow-hidden"},of=["onSubmit"],af={class:"flex min-h-0 flex-1 flex-col overflow-auto"},rf={class:"flex-1"},uf={class:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},df={class:"flex items-start justify-between space-x-3"},cf={class:"space-y-1"},ff={key:0},mf={key:2},vf=["innerHTML"],hf={class:"flex h-7 items-center"},gf={class:"flex justify-end"},pf=ce({__name:"AutoCreateForm",props:{type:null,formStyle:{default:"slideOver"},panelClass:null,formClass:null,headingClass:null,subHeadingClass:null,buttonsClass:null,heading:null,subHeading:null,autosave:{type:Boolean,default:!0},showLoading:{type:Boolean,default:!0},showCancel:{type:Boolean,default:!0},configureField:null,configureFormLayout:null},emits:["done","save","error"],setup(p,{expose:e,emit:n}){const r=p,m=A(),g=A(1);function t(){g.value++,null!=(e=m.value)&&e.forceUpdate();var e=Be();null!=(e=null==e?void 0:e.proxy)&&e.$forceUpdate()}function y(e){}e({forceUpdate:t,props:r,setModel:function(e){Object.assign(V.value,e),t()},formFields:m}),Xt("ModalProvider",{openModal:function(e,t){h.value=e,l.value=t}});const h=A(),l=A();async function b(e){l.value&&l.value(e),h.value=void 0,l.value=void 0}const{typeOf:i,typeProperties:d,Crud:c,createDto:v,formValues:x}=at(),C=f(()=>Et(r.type)),L=f(()=>i(C.value)),V=A("string"==typeof r.type?v(r.type):r.type?new r.type:null),M=f(()=>r.panelClass||Ze.panelClass(r.formStyle)),S=f(()=>r.formClass||Ze.formClass(r.formStyle)),I=f(()=>r.headingClass||Ze.headingClass(r.formStyle)),$=f(()=>r.subHeadingClass||Ze.subHeadingClass(r.formStyle)),F=f(()=>r.buttonsClass||Ze.buttonsClass),B=f(()=>c.model(L.value)),j=f(()=>{var e;return r.heading||(null==(e=i(C.value))?void 0:e.description)||(B.value?"New "+He(B.value):He(C.value))}),O=A(new Je);let H=Tl(),D=f(()=>H.loading.value);async function E(e){var t,l,a,e=e.target;r.autosave?(l=qe(null==(l=V.value)?void 0:l.getMethod,e=>"function"==typeof e?e():null)||"POST",t=null==qe(null==(t=V.value)?void 0:t.createResponse,e=>"function"==typeof e?e():null),ln.hasRequestBody(l)?(l=new V.value.constructor,a=new FormData(e),O.value=t?await H.apiFormVoid(l,a,{jsconfig:"eccn"}):await H.apiForm(l,a,{jsconfig:"eccn"})):(l=x(e,d(L.value)),a=new V.value.constructor(l),O.value=t?await H.apiVoid(a,{jsconfig:"eccn"}):await H.api(a,{jsconfig:"eccn"})),O.value.succeeded?(e.reset(),n("save",O.value.response)):n("error",O.value.error)):n("save",new V.value.constructor(x(e,d(L.value))))}function z(){n("done")}ne.interceptors.has("AutoCreateForm.new")&&ne.interceptors.invoke("AutoCreateForm.new",{props:r,model:V});const _=A(!1),R=A(""),N={entering:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-full",to:"translate-x-0"},leaving:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-0",to:"translate-x-full"}};function P(){"slideOver"==r.formStyle?_.value=!1:z()}Lt(_,()=>{Ct(N,R,_.value),_.value||setTimeout(z,700)}),_.value=!0;const U=e=>{"Escape"===e.key&&P()};return tt(()=>window.addEventListener("keydown",U)),Rt(()=>window.removeEventListener("keydown",U)),(e,t)=>{var l,n=X("AutoFormFields"),r=X("FormLoading"),i=X("SecondaryButton"),d=X("PrimaryButton"),c=X("CloseButton"),v=X("ModalLookup");return a(),u("div",null,[o(L)?"card"==p.formStyle?(a(),u("div",{key:1,class:w(o(M))},[s("form",{onSubmit:Ue(E,["prevent"])},[s("div",{class:w(o(S))},[s("div",null,[e.$slots.heading?(a(),u("div",X0,[Z(e.$slots,"heading")])):(a(),u("h3",{key:1,class:w(o(I))},T(o(j)),3)),e.$slots.subheading?(a(),u("div",Y0,[Z(e.$slots,"subheading")])):p.subHeading?(a(),u("p",{key:3,class:w(o($))},T(p.subHeading),3)):null!=(l=o(L))&&l.notes?(a(),u("p",{key:4,class:w(["notes",o($)]),innerHTML:null==(l=o(L))?void 0:l.notes},null,10,ef)):k("",!0)]),Z(e.$slots,"header",{formInstance:null==(l=Be())?void 0:l.exposed,model:V.value}),(a(),se(n,{ref_key:"formFields",ref:m,key:g.value,modelValue:V.value,"onUpdate:modelValue":y,api:O.value,configureField:p.configureField,configureFormLayout:p.configureFormLayout},null,8,["modelValue","api","configureField","configureFormLayout"])),Z(e.$slots,"footer",{formInstance:null==(l=Be())?void 0:l.exposed,model:V.value})],2),s("div",{class:w(o(F))},[s("div",null,[p.showLoading&&o(D)?(a(),se(r,{key:0})):k("",!0)]),s("div",tf,[p.showCancel?(a(),se(i,{key:0,onClick:P,disabled:o(D)},{default:ke(()=>[we("Cancel")]),_:1},8,["disabled"])):k("",!0),$e(d,{type:"submit",class:"ml-4",disabled:o(D)},{default:ke(()=>[we("Save")]),_:1},8,["disabled"])])],2)],40,J0)],2)):(a(),u("div",lf,[nf,s("div",sf,[s("div",{onMousedown:P,class:"absolute inset-0 overflow-hidden"},[s("div",{onMousedown:t[0]||(t[0]=Ue(()=>{},["stop"])),class:"pointer-events-none fixed inset-y-0 right-0 flex pl-10"},[s("div",{class:w(["pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",R.value])},[s("form",{class:w(o(S)),onSubmit:Ue(E,["prevent"])},[s("div",af,[s("div",rf,[s("div",uf,[s("div",df,[s("div",cf,[e.$slots.heading?(a(),u("div",ff,[Z(e.$slots,"heading")])):(a(),u("h3",{key:1,class:w(o(I))},T(o(j)),3)),e.$slots.subheading?(a(),u("div",mf,[Z(e.$slots,"subheading")])):p.subHeading?(a(),u("p",{key:3,class:w(o($))},T(p.subHeading),3)):null!=(l=o(L))&&l.notes?(a(),u("p",{key:4,class:w(["notes",o($)]),innerHTML:null==(t=o(L))?void 0:t.notes},null,10,vf)):k("",!0)]),s("div",hf,[$e(c,{"button-class":"bg-gray-50 dark:bg-gray-900",onClose:P})])])]),Z(e.$slots,"header",{formInstance:null==(l=Be())?void 0:l.exposed,model:V.value}),(a(),se(n,{ref_key:"formFields",ref:m,key:g.value,modelValue:V.value,"onUpdate:modelValue":y,api:O.value,configureField:p.configureField,configureFormLayout:p.configureFormLayout},null,8,["modelValue","api","configureField","configureFormLayout"])),Z(e.$slots,"footer",{formInstance:null==(t=Be())?void 0:t.exposed,model:V.value})])]),s("div",{class:w(o(F))},[s("div",null,[p.showLoading&&o(D)?(a(),se(r,{key:0})):k("",!0)]),s("div",gf,[p.showCancel?(a(),se(i,{key:0,onClick:P,disabled:o(D)},{default:ke(()=>[we("Cancel")]),_:1},8,["disabled"])):k("",!0),$e(d,{type:"submit",class:"ml-4",disabled:o(D)},{default:ke(()=>[we("Save")]),_:1},8,["disabled"])])],2)],42,of)],2)],32)],32)])])):(a(),u("div",Z0,[s("p",G0,[we("Could not create form for unknown "),W0,we(" "+T(o(C)),1)])])),"ModalLookup"==(null==(c=h.value)?void 0:c.name)&&h.value.ref?(a(),se(v,{key:3,"ref-info":h.value.ref,onDone:b},null,8,["ref-info"])):k("",!0)])}}}),yf={key:0},bf={class:"text-red-700"},wf=s("b",null,"type",-1),xf=["onSubmit"],kf={key:0},$f={key:2},Cf=["innerHTML"],_f={class:"flex justify-end"},Lf={key:2,class:"relative z-10","aria-labelledby":"slide-over-title",role:"dialog","aria-modal":"true"},Vf=s("div",{class:"fixed inset-0"},null,-1),Sf={class:"fixed inset-0 overflow-hidden"},Mf=["onSubmit"],Af={class:"flex min-h-0 flex-1 flex-col overflow-auto"},Tf={class:"flex-1"},Ff={class:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},If={class:"flex items-start justify-between space-x-3"},Df={class:"space-y-1"},jf={key:0},Of={key:2},Pf=["innerHTML"],Bf={class:"flex h-7 items-center"},Rf={class:"flex justify-end"},Ef=ce({__name:"AutoEditForm",props:{modelValue:null,type:null,deleteType:null,formStyle:{default:"slideOver"},panelClass:null,formClass:null,headingClass:null,subHeadingClass:null,heading:null,subHeading:null,autosave:{type:Boolean,default:!0},showLoading:{type:Boolean,default:!0},configureField:null,configureFormLayout:null},emits:["done","save","delete","error"],setup(p,{expose:e,emit:n}){const r=p,m=A(),g=A(1);function y(e){}e({forceUpdate:function(){g.value++,V.value=L();var e=Be();null!=(e=null==e?void 0:e.proxy)&&e.$forceUpdate()},props:r,setModel:function(e){Object.assign(V.value,e)},formFields:m}),Xt("ModalProvider",{openModal:function(e,t){h.value=e,l.value=t}});const h=A(),l=A();async function b(e){l.value&&l.value(e),h.value=void 0,l.value=void 0}const{typeOf:t,apiOf:q,typeProperties:i,createFormLayout:Q,getPrimaryKey:K,Crud:c,createDto:d,formValues:v}=at(),x=f(()=>Et(r.type)),C=f(()=>t(x.value)),L=()=>"string"==typeof r.type?d(r.type,ml(r.modelValue)):r.type?new r.type(ml(r.modelValue)):null,V=A(L()),W=f(()=>r.panelClass||Ze.panelClass(r.formStyle)),M=f(()=>r.formClass||Ze.formClass(r.formStyle)),S=f(()=>r.headingClass||Ze.headingClass(r.formStyle)),I=f(()=>r.subHeadingClass||Ze.subHeadingClass(r.formStyle)),$=f(()=>c.model(C.value)),F=f(()=>{var e;return r.heading||(null==(e=t(x.value))?void 0:e.description)||($.value?"Update "+He($.value):He(x.value))}),B=A(new Je);let j=Object.assign({},ml(r.modelValue)),O=(ne.interceptors.has("AutoEditForm.new")&&ne.interceptors.invoke("AutoEditForm.new",{props:r,model:V,origModel:j}),Tl()),H=f(()=>O.loading.value);const D=()=>qe(t(c.model(C.value)),e=>K(e));function G(e){var{op:t,prop:l}=e;t&&(c.isPatch(t)||c.isUpdate(t))&&(e.disabled=null==l?void 0:l.isPrimaryKey),r.configureField&&r.configureField(e)}async function E(a){a=a.target;if(r.autosave){let e=qe(null==(s=V.value)?void 0:s.getMethod,e=>"function"==typeof e?e():null)||"POST",l=null==qe(null==(s=V.value)?void 0:s.createResponse,e=>"function"==typeof e?e():null),d=D();if(ln.hasRequestBody(e)){let e=new V.value.constructor,t=ye(r.modelValue,d.name),i=new FormData(a),u=(d&&!Array.from(i.keys()).some(e=>e.toLowerCase()==d.name.toLowerCase())&&i.append(d.name,t),[]);var s=x.value&&q(x.value);if(s&&c.isPatch(s)){let o=Q(C.value),r={};if(d&&(r[d.name]=t),o.forEach(l=>{var a=l.id,s=ye(j,a);if(!d||d.name.toLowerCase()!==a.toLowerCase()){var n=i.get(a);ne.interceptors.has("AutoEditForm.save.formLayout")&&ne.interceptors.invoke("AutoEditForm.save.formLayout",{origValue:s,formLayout:o,input:l,newValue:n});let e=null!=n,t="checkbox"===l.type?e!=!!s:"file"===l.type?e:n!=s;(t=n||s?t:!1)&&(n?r[a]=n:"file"!==l.type&&u.push(a))}}),ne.interceptors.has("AutoEditForm.save")&&ne.interceptors.invoke("AutoEditForm.save",{origModel:j,formLayout:o,dirtyValues:r}),Array.from(i.keys()).filter(e=>!r[e]).forEach(e=>i.delete(e)),0==Array.from(i.keys()).filter(e=>e.toLowerCase()!=d.name.toLowerCase()).length&&0==u.length)return void P()}s=0<u.length?{jsconfig:"eccn",reset:u}:{jsconfig:"eccn"};B.value=l?await O.apiFormVoid(e,i,s):await O.apiForm(e,i,s)}else{s=v(a,i(C.value)),s=(d&&!ye(s,d.name)&&(s[d.name]=ye(r.modelValue,d.name)),new V.value.constructor(s));B.value=l?await O.apiVoid(s,{jsconfig:"eccn"}):await O.api(s,{jsconfig:"eccn"})}B.value.succeeded?(a.reset(),n("save",B.value.response)):n("error",B.value.error)}else n("save",new V.value.constructor(v(a,i(C.value))))}async function z(e){var t=D(),l=t?ye(r.modelValue,t.name):null;l?(t={[t.name]:l},l="string"==typeof r.deleteType?d(r.deleteType,t):r.deleteType?new r.deleteType(t):null,null==qe(l.createResponse,e=>"function"==typeof e?e():null)?B.value=await O.apiVoid(l):B.value=await O.api(l),B.value.succeeded?n("delete",B.value.response):n("error",B.value.error)):console.error(`Could not find Primary Key for Type ${x.value} (${$.value})`)}function _(){n("done")}const R=A(!1),N=A(""),J={entering:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-full",to:"translate-x-0"},leaving:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-0",to:"translate-x-full"}};function P(){"slideOver"==r.formStyle?R.value=!1:_()}Lt(R,()=>{Ct(J,N,R.value),R.value||setTimeout(_,700)}),R.value=!0;const U=e=>{"Escape"===e.key&&P()};return tt(()=>window.addEventListener("keydown",U)),Rt(()=>window.removeEventListener("keydown",U)),(e,t)=>{var l,n=X("AutoFormFields"),r=X("ConfirmDelete"),i=X("FormLoading"),d=X("SecondaryButton"),c=X("PrimaryButton"),v=X("CloseButton"),f=X("ModalLookup");return a(),u("div",null,[o(C)?"card"==p.formStyle?(a(),u("div",{key:1,class:w(o(W))},[s("form",{onSubmit:Ue(E,["prevent"])},[s("div",{class:w(o(M))},[s("div",null,[e.$slots.heading?(a(),u("div",kf,[Z(e.$slots,"heading")])):(a(),u("h3",{key:1,class:w(o(S))},T(o(F)),3)),e.$slots.subheading?(a(),u("div",$f,[Z(e.$slots,"subheading")])):p.subHeading?(a(),u("p",{key:3,class:w(o(I))},T(p.subHeading),3)):null!=(l=o(C))&&l.notes?(a(),u("p",{key:4,class:w(["notes",o(I)]),innerHTML:null==(l=o(C))?void 0:l.notes},null,10,Cf)):k("",!0)]),Z(e.$slots,"header",{formInstance:null==(l=Be())?void 0:l.exposed,model:V.value}),(a(),se(n,{ref_key:"formFields",ref:m,key:g.value,modelValue:V.value,"onUpdate:modelValue":y,api:B.value,configureField:p.configureField,configureFormLayout:p.configureFormLayout},null,8,["modelValue","api","configureField","configureFormLayout"])),Z(e.$slots,"footer",{formInstance:null==(l=Be())?void 0:l.exposed,model:V.value})],2),s("div",{class:w(o(Ze).buttonsClass)},[s("div",null,[p.deleteType?(a(),se(r,{key:0,onDelete:z})):k("",!0)]),s("div",null,[p.showLoading&&o(H)?(a(),se(i,{key:0})):k("",!0)]),s("div",_f,[$e(d,{onClick:P,disabled:o(H)},{default:ke(()=>[we("Cancel")]),_:1},8,["disabled"]),$e(c,{type:"submit",class:"ml-4",disabled:o(H)},{default:ke(()=>[we("Save")]),_:1},8,["disabled"])])],2)],40,xf)],2)):(a(),u("div",Lf,[Vf,s("div",Sf,[s("div",{onMousedown:P,class:"absolute inset-0 overflow-hidden"},[s("div",{onMousedown:t[0]||(t[0]=Ue(()=>{},["stop"])),class:"pointer-events-none fixed inset-y-0 right-0 flex pl-10"},[s("div",{class:w(["pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",N.value])},[s("form",{class:w(o(M)),onSubmit:Ue(E,["prevent"])},[s("div",Af,[s("div",Tf,[s("div",Ff,[s("div",If,[s("div",Df,[e.$slots.heading?(a(),u("div",jf,[Z(e.$slots,"heading")])):(a(),u("h3",{key:1,class:w(o(S))},T(o(F)),3)),e.$slots.subheading?(a(),u("div",Of,[Z(e.$slots,"subheading")])):p.subHeading?(a(),u("p",{key:3,class:w(o(I))},T(p.subHeading),3)):null!=(l=o(C))&&l.notes?(a(),u("p",{key:4,class:w(["notes",o(I)]),innerHTML:null==(t=o(C))?void 0:t.notes},null,10,Pf)):k("",!0)]),s("div",Bf,[$e(v,{"button-class":"bg-gray-50 dark:bg-gray-900",onClose:P})])])]),Z(e.$slots,"header",{formInstance:null==(l=Be())?void 0:l.exposed,model:V.value}),(a(),se(n,{ref_key:"formFields",ref:m,key:g.value,modelValue:V.value,"onUpdate:modelValue":y,api:B.value,configureField:G,configureFormLayout:p.configureFormLayout},null,8,["modelValue","api","configureFormLayout"])),Z(e.$slots,"footer",{formInstance:null==(t=Be())?void 0:t.exposed,model:V.value})])]),s("div",{class:w(o(Ze).buttonsClass)},[s("div",null,[p.deleteType?(a(),se(r,{key:0,onDelete:z})):k("",!0)]),s("div",null,[p.showLoading&&o(H)?(a(),se(i,{key:0})):k("",!0)]),s("div",Rf,[$e(d,{onClick:P,disabled:o(H)},{default:ke(()=>[we("Cancel")]),_:1},8,["disabled"]),$e(c,{type:"submit",class:"ml-4",disabled:o(H)},{default:ke(()=>[we("Save")]),_:1},8,["disabled"])])],2)],42,Mf)],2)],32)],32)])])):(a(),u("div",yf,[s("p",bf,[we("Could not create form for unknown "),wf,we(" "+T(o(x)),1)])])),"ModalLookup"==(null==(v=h.value)?void 0:v.name)&&h.value.ref?(a(),se(f,{key:3,"ref-info":h.value.ref,onDone:b},null,8,["ref-info"])):k("",!0)])}}}),Hf=s("label",{for:"confirmDelete",class:"ml-2 mr-2 select-none"},"confirm",-1),zf=["onClick"],Nf=ce({__name:"ConfirmDelete",emits:["delete"],setup(e,{emit:t}){let l=A(!1);const n=()=>{l.value&&t("delete")},r=f(()=>["select-none inline-flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-md text-white",l.value?"cursor-pointer bg-red-600 hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500":"bg-red-400"]);return(e,t)=>(a(),u(Te,null,[kt(s("input",{id:"confirmDelete",type:"checkbox",class:"focus:ring-indigo-500 h-4 w-4 text-indigo-600 rounded border-gray-300 dark:border-gray-600 dark:bg-gray-800 dark:ring-offset-black","onUpdate:modelValue":t[0]||(t[0]=e=>Gn(l)?l.value=e:l=e)},null,512),[[Yl,o(l)]]),Hf,s("span",Me({onClick:Ue(n,["prevent"]),class:o(r)},e.$attrs),[Z(e.$slots,"default",{},()=>[we("Delete")])],16,zf)],64))}}),Uf={class:"flex",title:"loading..."},qf={key:0,xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",width:"24px",height:"30px",viewBox:"0 0 24 30"},Qf=wl('<rect x="0" y="10" width="4" height="10" fill="#333" opacity="0.2"><animate attributeName="opacity" attributeType="XML" values="0.2; 1; .2" begin="0s" dur="0.6s" repeatCount="indefinite"></animate><animate attributeName="height" attributeType="XML" values="10; 20; 10" begin="0s" dur="0.6s" repeatCount="indefinite"></animate><animate attributeName="y" attributeType="XML" values="10; 5; 10" begin="0s" dur="0.6s" repeatCount="indefinite"></animate></rect><rect x="8" y="10" width="4" height="10" fill="#333" opacity="0.2"><animate attributeName="opacity" attributeType="XML" values="0.2; 1; .2" begin="0.15s" dur="0.6s" repeatCount="indefinite"></animate><animate attributeName="height" attributeType="XML" values="10; 20; 10" begin="0.15s" dur="0.6s" repeatCount="indefinite"></animate><animate attributeName="y" attributeType="XML" values="10; 5; 10" begin="0.15s" dur="0.6s" repeatCount="indefinite"></animate></rect><rect x="16" y="10" width="4" height="10" fill="#333" opacity="0.2"><animate attributeName="opacity" attributeType="XML" values="0.2; 1; .2" begin="0.3s" dur="0.6s" repeatCount="indefinite"></animate><animate attributeName="height" attributeType="XML" values="10; 20; 10" begin="0.3s" dur="0.6s" repeatCount="indefinite"></animate><animate attributeName="y" attributeType="XML" values="10; 5; 10" begin="0.3s" dur="0.6s" repeatCount="indefinite"></animate></rect>',3),Kf=[Qf],Zf={class:"ml-2 mt-1 text-gray-400"},Gf=ce({__name:"FormLoading",props:{icon:{type:Boolean,default:!0},text:{default:"loading..."}},setup(l){return Ne("ApiState",void 0),(e,t)=>(a(),u("div",Uf,[l.icon?(a(),u("svg",qf,Kf)):k("",!0),s("span",Zf,T(l.text),1)]))}}),Wf=["onClick"],Jf={key:3,class:"flex justify-between items-center"},Xf={class:"mr-1 select-none"},Yf=["onClick"],e1=ce({__name:"DataGrid",props:{items:{default:()=>[]},id:{default:"DataGrid"},type:null,tableStyle:{default:"stripedRows"},selectedColumns:null,gridClass:null,grid2Class:null,grid3Class:null,grid4Class:null,tableClass:null,theadClass:null,tbodyClass:null,theadRowClass:null,theadCellClass:null,isSelected:null,headerTitle:null,headerTitles:null,visibleFrom:null,rowClass:null,rowStyle:null},emits:["headerSelected","rowSelected"],setup(t,{emit:d}){const c=t,l=A(),v=A(null),p=en(),m=t=>Object.keys(p).find(e=>e.toLowerCase()==t.toLowerCase()+"-header"),g=t=>Object.keys(p).find(e=>e.toLowerCase()==t.toLowerCase()),n=f(()=>Nl(c.items).filter(e=>!(!p[e]&&!p[e+"-header"]))),{typeOf:e,typeProperties:r}=at(),i=f(()=>Et(c.type)),y=f(()=>e(i.value)),h=f(()=>r(y.value));function b(e){e=c.headerTitles&&ye(c.headerTitles,e)||e;return c.headerTitle?c.headerTitle(e):ts(e)}function x(e){const t=e.toLowerCase();return h.value.find(e=>e.name.toLowerCase()==t)}const C={xs:"xs:table-cell",sm:"sm:table-cell",md:"md:table-cell",lg:"lg:table-cell",xl:"xl:table-cell","2xl":"2xl:table-cell",never:""};function L(e){e=c.visibleFrom&&ye(c.visibleFrom,e);return e&&qe(C[e],e=>"hidden "+e)}const V=f(()=>c.gridClass??ge.getGridClass(c.tableStyle)),M=f(()=>c.grid2Class??ge.getGrid2Class(c.tableStyle)),S=f(()=>c.grid3Class??ge.getGrid3Class(c.tableStyle)),I=f(()=>c.grid4Class??ge.getGrid4Class(c.tableStyle)),$=f(()=>c.tableClass??ge.getTableClass(c.tableStyle)),F=f(()=>c.tbodyClass??ge.getTbodyClass(c.tbodyClass)),B=f(()=>c.theadClass??ge.getTheadClass(c.tableStyle)),j=f(()=>c.theadRowClass??ge.getTheadRowClass(c.tableStyle)),O=f(()=>c.theadCellClass??ge.getTheadCellClass(c.tableStyle));const H=f(()=>{const e=("string"==typeof c.selectedColumns?c.selectedColumns.split(","):c.selectedColumns)||(0<n.value.length?n.value:Nl(c.items)),t=h.value.reduce((e,t)=>(e[t.name.toLowerCase()]=t.format,e),{});return e.filter(e=>{return"hidden"!=(null==(e=t[e.toLowerCase()])?void 0:e.method)})});return(n,e)=>{const r=X("CellFormat"),i=X("PreviewFormat");return t.items.length?(a(),u("div",{key:0,ref_key:"refResults",ref:l,class:w(o(V))},[s("div",{class:w(o(M))},[s("div",{class:w(o(S))},[s("div",{class:w(o(I))},[s("table",{class:w(o($))},[s("thead",{class:w(o(B))},[s("tr",{class:w(o(j))},[(a(!0),u(Te,null,Ie(o(H),t=>{return a(),u("td",{class:w([L(t),o(O),(e=t,v.value===e?"text-gray-900 dark:text-gray-50":"text-gray-500 dark:text-gray-400")])},[s("div",{onClick:e=>{d("headerSelected",t,e)}},[o(p)[t+"-header"]?Z(n.$slots,t+"-header",{key:0,column:t}):m(t)?Z(n.$slots,m(t),{key:1,column:t}):o(p).header?Z(n.$slots,"header",{key:2,column:t,label:b(t)}):(a(),u("div",Jf,[s("span",Xf,T(b(t)),1)]))],8,Wf)],2);var e}),256))],2)],2),s("tbody",{class:w(o(F))},[(a(!0),u(Te,null,Ie(t.items,(t,e)=>{return a(),u("tr",{class:w((l=t,s=e,c.rowClass?c.rowClass(l,s):ge.getTableRowClass(c.tableStyle,s,!(!c.isSelected||!c.isSelected(l)),null!=c.isSelected))),style:Xl((s=t,l=e,c.rowStyle?c.rowStyle(s,l):void 0)),onClick:e=>{d("rowSelected",t,e)}},[(a(!0),u(Te,null,Ie(o(H),e=>{return a(),u("td",{class:w([L(e),o(ge).tableCellClass])},[o(p)[e]?Z(n.$slots,e,jt(Me({key:0},t))):g(e)?Z(n.$slots,g(e),jt(Me({key:1},t))):x(e)?(a(),se(r,{key:2,type:o(y),propType:x(e),modelValue:t},null,8,["type","propType","modelValue"])):(a(),se(i,{key:3,value:o(ye)(t,e),format:null!=(e=x(e=e))&&e.format?e.format:"TimeSpan"==(null==e?void 0:e.type)||"TimeOnly"==(null==e?void 0:e.type)?{method:"time"}:null},null,8,["value","format"]))],2)}),256))],14,Yf);var l,s}),256))],2)],2)],2)],2)],2)],2)):k("",!0)}}}),t1=ce({props:{type:Object,propType:Object,modelValue:Object},setup(i,{attrs:u}){const d=at()["typeOf"];return()=>{var e,t;const l=null!=(e=i.propType)&&e.format?e.format:"TimeSpan"==(null==e?void 0:e.type)||"TimeOnly"==(null==e?void 0:e.type)?{method:"time"}:null,a=ye(i.modelValue,i.propType.name),s=Object.assign({},i,u),n=gt("span",{innerHTML:Jt(a,l,s)}),o=Zt(a)&&Array.isArray(a)?gt("span",{},[gt("span",{class:"mr-2"},""+a.length),n]):n,r=null==(e=i.propType)?void 0:e.ref;return r&&(e=et(i.type).find(e=>e.type===r.model))&&(e=(e=ye(i.modelValue,e.name))&&r.refLabel&&ye(e,r.refLabel))?(t=(t=null==(t=d(r.model))?void 0:t.icon)?gt(zs,{image:t,class:"w-5 h-5 mr-1"}):null,gt("span",{class:"flex",title:r.model+" "+a},[t,e])):o}}}),l1={key:0},n1={key:0,class:"mr-2"},s1=["innerHTML"],o1=["innerHTML"],a1={inheritAttrs:!1},i1=ce({...a1,__name:"PreviewFormat",props:{value:null,format:null,includeIcon:{type:Boolean,default:!0},includeCount:{type:Boolean,default:!0},maxFieldLength:{default:150},maxNestedFields:{default:2},maxNestedFieldLength:{default:30}},setup(l){const e=l,n=f(()=>Array.isArray(e.value));return(e,t)=>o(Zt)(l.value)?(a(),u("span",l1,[l.includeCount&&o(n)?(a(),u("span",n1,T(l.value.length),1)):k("",!0),s("span",{innerHTML:o(Jt)(l.value,l.format,e.$attrs)},null,8,s1)])):(a(),u("span",{key:1,innerHTML:o(Jt)(l.value,l.format,e.$attrs)},null,8,o1))}}),r1=["innerHTML"],u1={key:0},d1=s("b",null,null,-1),c1={key:2},f1=ce({__name:"HtmlFormat",props:{value:null,depth:{default:0},fieldAttrs:null,classes:{type:Function,default:(e,t,l,a,s)=>a}},setup(r){const t=r,i=f(()=>_t(t.value)),d=f(()=>Array.isArray(t.value)),c=e=>ts(e),v=e=>t.fieldAttrs?t.fieldAttrs(e):null,p=f(()=>Nl(t.value));return(e,t)=>{const l=X("HtmlFormat",!0);return a(),u("div",{class:w(0==r.depth?"prose html-format":"")},[o(i)?(a(),u("div",{key:0,innerHTML:o(Jt)(r.value)},null,8,r1)):o(d)?(a(),u("div",{key:1,class:w(r.classes("array","div",r.depth,o(ge).gridClass))},[o(_t)(r.value[0])?(a(),u("div",u1,"[ "+T(r.value.join(", "))+" ]",1)):(a(),u("div",{key:1,class:w(r.classes("array","div",r.depth,o(ge).grid2Class))},[s("div",{class:w(r.classes("array","div",r.depth,o(ge).grid3Class))},[s("div",{class:w(r.classes("array","div",r.depth,o(ge).grid4Class))},[s("table",{class:w(r.classes("object","table",r.depth,o(ge).tableClass))},[s("thead",{class:w(r.classes("array","thead",r.depth,o(ge).theadClass))},[s("tr",null,[(a(!0),u(Te,null,Ie(o(p),e=>(a(),u("th",{class:w(r.classes("array","th",r.depth,o(ge).theadCellClass+" whitespace-nowrap"))},[d1,we(T(c(e)),1)],2))),256))])],2),s("tbody",null,[(a(!0),u(Te,null,Ie(r.value,(t,e)=>(a(),u("tr",{class:w(r.classes("array","tr",r.depth,e%2==0?"bg-white":"bg-gray-50",e))},[(a(!0),u(Te,null,Ie(o(p),e=>(a(),u("td",{class:w(r.classes("array","td",r.depth,o(ge).tableCellClass))},[$e(l,Me({value:t[e],"field-attrs":r.fieldAttrs,depth:r.depth+1,classes:r.classes},v(e)),null,16,["value","field-attrs","depth","classes"])],2))),256))],2))),256))])],2)],2)],2)],2))],2)):(a(),u("div",c1,[s("table",{class:w(r.classes("object","table",r.depth,"table-object"))},[(a(!0),u(Te,null,Ie((n=r.value)?Object.keys(n).map(e=>({key:c(e),val:n[e]})):[],e=>(a(),u("tr",{class:w(r.classes("object","tr",r.depth,""))},[s("th",{class:w(r.classes("object","th",r.depth,"align-top py-2 px-4 text-left text-sm font-medium tracking-wider whitespace-nowrap"))},T(e.key),3),s("td",{class:w(r.classes("object","td",r.depth,"align-top py-2 px-4 text-sm"))},[$e(l,Me({value:e.val,"field-attrs":r.fieldAttrs,depth:r.depth+1,classes:r.classes},v(e.key)),null,16,["value","field-attrs","depth","classes"])],2)],2))),256))],2)]))],2);var n}}}),m1={class:"absolute top-0 right-0 pt-4 pr-4"},v1=s("span",{class:"sr-only"},"Close",-1),h1=s("svg",{class:"h-6 w-6",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true"},[s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1),g1=[v1,h1],p1=ce({__name:"CloseButton",props:{buttonClass:{default:"bg-white dark:bg-black"}},emits:["close"],setup(l,{}){return(t,e)=>(a(),u("div",m1,[s("button",{type:"button",onClick:e[0]||(e[0]=e=>t.$emit("close")),class:w([l.buttonClass,"rounded-md text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:ring-offset-black"])},g1,2)]))}}),y1=["id","aria-labelledby"],b1=s("div",{class:"fixed inset-0"},null,-1),w1={class:"fixed inset-0 overflow-hidden"},x1={class:"flex h-full flex-col bg-white dark:bg-black shadow-xl"},k1={class:"flex min-h-0 flex-1 flex-col overflow-auto"},$1={class:"flex-1"},C1={class:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},_1={class:"flex items-start justify-between space-x-3"},L1={class:"space-y-1"},V1=["id"],S1={key:1,class:"text-sm text-gray-500"},M1={class:"flex h-7 items-center"},A1={class:"flex-shrink-0 border-t border-gray-200 dark:border-gray-700 px-4 py-5 sm:px-6"},T1=ce({__name:"SlideOver",props:{id:{default:"SlideOver"},title:null,contentClass:{default:"relative mt-6 flex-1 px-4 sm:px-6"}},emits:["done"],setup(n,{emit:e}){const t=A(!1),o=A(""),l={entering:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-full",to:"translate-x-0"},leaving:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-0",to:"translate-x-full"}},r=(Lt(t,()=>{Ct(l,o,t.value),t.value||setTimeout(()=>e("done"),700)}),t.value=!0,()=>t.value=!1),i=e=>{"Escape"===e.key&&r()};return tt(()=>window.addEventListener("keydown",i)),Rt(()=>window.removeEventListener("keydown",i)),(e,t)=>{var l=X("CloseButton");return a(),u("div",{id:n.id,class:"relative z-10","aria-labelledby":n.id+"-title",role:"dialog","aria-modal":"true"},[b1,s("div",w1,[s("div",{onMousedown:r,class:"absolute inset-0 overflow-hidden"},[s("div",{onMousedown:t[0]||(t[0]=Ue(()=>{},["stop"])),class:"pointer-events-none fixed inset-y-0 right-0 flex pl-10"},[s("div",{class:w(["pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",o.value])},[s("div",x1,[s("div",k1,[s("div",$1,[s("div",C1,[s("div",_1,[s("div",L1,[n.title?(a(),u("h2",{key:0,class:"text-lg font-medium text-gray-900 dark:text-gray-50",id:n.id+"-title"},T(n.title),9,V1)):k("",!0),e.$slots.subtitle?(a(),u("p",S1,[Z(e.$slots,"subtitle")])):k("",!0)]),s("div",M1,[$e(l,{"button-class":"bg-gray-50 dark:bg-gray-900",onClose:r})])])]),s("div",{class:w(n.contentClass)},[Z(e.$slots,"default")],2)])]),s("div",A1,[Z(e.$slots,"footer")])])],2)],32)],32)])],8,y1)}}}),F1=["id","data-transition-for","aria-labelledby"],I1={class:"fixed inset-0 z-10 overflow-y-auto"},D1={class:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0"},j1=s("span",{class:"sr-only"},"Close",-1),O1=s("svg",{class:"h-6 w-6",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true"},[s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1),P1=[j1,O1],B1=ce({__name:"ModalDialog",props:{id:{default:"ModalDialog"},modalClass:{default:Jl.modalClass},sizeClass:{default:Jl.sizeClass}},emits:["done"],setup(n,{emit:e}){const t=A(!1),o=A(""),l={entering:{cls:"ease-out duration-300",from:"opacity-0",to:"opacity-100"},leaving:{cls:"ease-in duration-200",from:"opacity-100",to:"opacity-0"}},r=A(""),i={entering:{cls:"ease-out duration-300",from:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",to:"opacity-100 translate-y-0 sm:scale-100"},leaving:{cls:"ease-in duration-200",from:"opacity-100 translate-y-0 sm:scale-100",to:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"}},d=(Lt(t,()=>{Ct(l,o,t.value),Ct(i,r,t.value),t.value||setTimeout(()=>e("done"),200)}),t.value=!0,()=>t.value=!1),c=(Xt("ModalProvider",{openModal:function(e,t){c.value=e,v.value=t}}),A()),v=A();async function f(e){v.value&&v.value(e),c.value=void 0,v.value=void 0}const p=e=>{"Escape"===e.key&&d()};return tt(()=>window.addEventListener("keydown",p)),Rt(()=>window.removeEventListener("keydown",p)),(e,t)=>{var l=X("ModalLookup");return a(),u("div",{id:n.id,"data-transition-for":n.id,onMousedown:d,class:"relative z-10","aria-labelledby":n.id+"-title",role:"dialog","aria-modal":"true"},[s("div",{class:w(["fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity",o.value])},null,2),s("div",I1,[s("div",D1,[s("div",{class:w([n.modalClass,n.sizeClass,r.value]),onMousedown:t[0]||(t[0]=Ue(()=>{},["stop"]))},[s("div",null,[s("div",{class:"hidden sm:block absolute top-0 right-0 pt-4 pr-4 z-10"},[s("button",{type:"button",onClick:d,class:"bg-white dark:bg-black rounded-md text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:ring-offset-black"},P1)]),Z(e.$slots,"default")])],34)])]),"ModalLookup"==(null==(t=c.value)?void 0:t.name)&&c.value.ref?(a(),se(l,{key:0,"ref-info":c.value.ref,onDone:f},null,8,["ref-info"])):k("",!0)],40,F1)}}}),R1={class:"pt-2 overflow-auto",style:{"min-height":"620px"}},E1={class:"mt-3 pl-5 flex flex-wrap items-center"},H1={class:"hidden sm:block text-xl leading-6 font-medium text-gray-900 dark:text-gray-50 mr-3"},z1={class:"hidden md:inline"},N1={class:"flex pb-1 sm:pb-0"},U1=["title"],q1=s("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[s("g",{"stroke-width":"1.5",fill:"none"},[s("path",{d:"M9 3H3.6a.6.6 0 0 0-.6.6v16.8a.6.6 0 0 0 .6.6H9M9 3v18M9 3h6M9 21h6m0-18h5.4a.6.6 0 0 1 .6.6v16.8a.6.6 0 0 1-.6.6H15m0-18v18",stroke:"currentColor"})])],-1),Q1=[q1],K1=["disabled"],Z1=s("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[s("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6l6 6zM6 6h2v12H6z",fill:"currentColor"})],-1),G1=[Z1],W1=["disabled"],J1=s("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[s("path",{d:"M15.41 7.41L14 6l-6 6l6 6l1.41-1.41L10.83 12z",fill:"currentColor"})],-1),X1=[J1],Y1=["disabled"],em=s("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[s("path",{d:"M10 6L8.59 7.41L13.17 12l-4.58 4.59L10 18l6-6z",fill:"currentColor"})],-1),tm=[em],lm=["disabled"],nm=s("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[s("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6l-6-6zM16 6h2v12h-2z",fill:"currentColor"})],-1),sm=[nm],om={key:0,class:"flex pb-1 sm:pb-0"},am={class:"px-4 text-lg text-black dark:text-white"},im={key:0},rm={key:1},um=s("span",{class:"hidden xl:inline"}," Showing Results ",-1),dm={key:2},cm={key:1,class:"pl-2"},fm=s("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",viewBox:"0 0 24 24"},[s("path",{fill:"currentColor",d:"M6.78 2.72a.75.75 0 0 1 0 1.06L4.56 6h8.69a7.75 7.75 0 1 1-7.75 7.75a.75.75 0 0 1 1.5 0a6.25 6.25 0 1 0 6.25-6.25H4.56l2.22 2.22a.75.75 0 1 1-1.06 1.06l-3.5-3.5a.75.75 0 0 1 0-1.06l3.5-3.5a.75.75 0 0 1 1.06 0Z"})],-1),mm=[fm],vm={class:"flex pb-1 sm:pb-0"},hm={key:0,class:"pl-2"},gm=s("svg",{class:"flex-none w-5 h-5 mr-2 text-gray-400 dark:text-gray-500 group-hover:text-gray-500","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[s("path",{"fill-rule":"evenodd",d:"M3 3a1 1 0 011-1h12a1 1 0 011 1v3a1 1 0 01-.293.707L12 11.414V15a1 1 0 01-.293.707l-2 2A1 1 0 018 17v-5.586L3.293 6.707A1 1 0 013 6V3z","clip-rule":"evenodd"})],-1),pm={class:"mr-1"},ym={key:0,class:"h-5 w-5 text-gray-400 dark:text-gray-500 group-hover:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},bm=s("path",{"fill-rule":"evenodd",d:"M10 5a1 1 0 011 1v3h3a1 1 0 110 2h-3v3a1 1 0 11-2 0v-3H6a1 1 0 110-2h3V6a1 1 0 011-1z","clip-rule":"evenodd"},null,-1),wm=[bm],xm={key:1,class:"h-5 w-5 text-gray-400 dark:text-gray-500 group-hover:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},km=s("path",{"fill-rule":"evenodd",d:"M5 10a1 1 0 011-1h8a1 1 0 110 2H6a1 1 0 01-1-1z","clip-rule":"evenodd"},null,-1),$m=[km],Cm={key:1},_m={key:4},Lm={key:0},Vm={key:0,class:"cursor-pointer flex justify-between items-center hover:text-gray-900 dark:hover:text-gray-50"},Sm={class:"mr-1 select-none"},Mm={key:1,class:"flex justify-between items-center"},Am={class:"mr-1 select-none"},Tm=ce({__name:"ModalLookup",props:{id:{default:"ModalLookup"},refInfo:null,skip:{default:0},prefs:null,selectedColumns:null,allowFiltering:{type:[Boolean,null],default:!0},showPreferences:{type:[Boolean,null],default:!0},showPagingNav:{type:[Boolean,null],default:!0},showPagingInfo:{type:[Boolean,null],default:!0},showResetPreferences:{type:[Boolean,null],default:!0},showFiltersView:{type:[Boolean,null],default:!0},toolbarButtonClass:null,canFilter:null},emits:["done"],setup(c,{emit:l}){const v=c,p=en(),e=St()["config"],{metadataApi:t,filterDefinitions:n}=at(),r=Ne("client"),i=e.value.storage,m=f(()=>v.toolbarButtonClass??ge.toolbarButtonClass),g=f(()=>n.value),y=A({take:25}),h=A(new Je),b=A(v.skip),x=A(!1),C=A(),d=e=>"string"==typeof e?e.split(","):e||[];function L(e,t){return ge.getTableRowClass("fullWidth",t,!1,!0)}const V=f(()=>ot(v.refInfo.model)),M=f(()=>{var e=(0<(e=d(v.selectedColumns)).length?e:[]).map(e=>e.toLowerCase());const l=et(V.value);return 0<e.length?e.map(t=>l.find(e=>e.name.toLowerCase()===t)).filter(e=>null!=e):l}),S=f(()=>{let e=M.value.map(e=>e.name),t=d(y.value.selectedColumns).map(e=>e.toLowerCase());return 0<t.length?e.filter(e=>t.includes(e.toLowerCase())):e}),I=f(()=>y.value.take??25),$=f(()=>h.value.response?ye(h.value.response,"results"):[]),F=f(()=>{var e;return(null==(e=h.value.response)?void 0:e.total)??$.value.length??0}),B=f(()=>0<b.value),j=f(()=>0<b.value),O=f(()=>$.value.length>=I.value),H=f(()=>$.value.length>=I.value),D=A([]),q=f(()=>D.value.some(e=>0<e.settings.filters.length||!!e.settings.sort)),E=f(()=>D.value.map(e=>e.settings.filters.length).reduce((e,t)=>e+t,0)),Q=f(()=>el(V.value)),K=f(()=>{var e;return null==(e=t.value)?void 0:e.operations.find(e=>{var t;return(null==(t=e.dataModel)?void 0:t.name)==v.refInfo.model&&ze.isAnyQuery(e)})}),W=A(),z=A(!1),_=A(),R=()=>v.id+"/ApiPrefs/"+v.refInfo.model,N=e=>`Column/${v.id}:${v.refInfo.model}.`+e;async function P(e){b.value+=e,b.value<0&&(b.value=0);e=Math.floor(F.value/I.value)*I.value;b.value>e&&(b.value=e),await U()}async function G(e,t){l("done",e)}function J(){l("done",null)}function Y(t,e){var l,a=e.target;"TD"!==(null==a?void 0:a.tagName)&&(a=null==(a=null==a?void 0:a.closest("TABLE"))?void 0:a.getBoundingClientRect(),l=D.value.find(e=>e.name.toLowerCase()==t.toLowerCase()))&&a&&(e=("DIV"===(null==(a=e.target)?void 0:a.tagName)?e.target:null==(a=e.target)?void 0:a.closest("DIV")).getBoundingClientRect(),_.value={column:l,topLeft:{x:Math.max(Math.floor(e.x+25),343),y:Math.floor(115)}})}function ee(){_.value=null}async function te(e){var t=null==(t=_.value)?void 0:t.column;t&&(t.settings=e,i.setItem(N(t.name),JSON.stringify(t.settings)),await U()),_.value=null}async function le(e){i.setItem(N(e.name),JSON.stringify(e.settings)),await U()}async function ae(e){z.value=!1,y.value=e,i.setItem(R(),JSON.stringify(e)),await U()}async function U(){(async function(a){var s=K.value;if(s){let e=Gt(s,a),t=es(e=>{h.value.response=h.value.error=void 0,x.value=e}),l=await r.api(e);t(),xt(()=>h.value=l);s=ye(l.response,"results")||[];l.succeeded&&s.label}else console.error("No Query API was found for "+v.refInfo.model)})(function(){let a={include:"total",take:I.value},e=d(y.value.selectedColumns||v.selectedColumns);{var t;0<e.length&&((t=Q.value)&&e.includes(t.name)&&(e=[t.name,...e]),a.fields=e.join(","))}let s=[];return D.value.forEach(l=>{l.settings.sort&&s.push(("DESC"===l.settings.sort?"-":"")+l.name),l.settings.filters.forEach(e=>{var t=e.key.replace("%",l.name);a[t]=e.value})}),"u"<typeof a.skip&&0<b.value&&(a.skip=b.value),0<s.length&&(a.orderBy=s.join(",")),a}())}async function ne(){D.value.forEach(e=>{e.settings={filters:[]},i.removeItem(N(e.name))}),await U()}return tt(async()=>{var e=v.prefs||yl(i.getItem(R()));e&&(y.value=e),D.value=M.value.map(e=>({name:e.name,type:e.type,meta:e,settings:Object.assign({filters:[]},yl(i.getItem(N(e.name))))})),isNaN(v.skip)||(b.value=v.skip),await U()}),(l,e)=>{const t=X("ErrorSummary"),n=X("Loading"),r=X("SettingsIcons"),i=X("DataGrid"),d=X("ModalDialog");return a(),u(Te,null,[c.refInfo?(a(),se(d,{key:0,ref_key:"modalDialog",ref:W,id:c.id,onDone:J},{default:ke(()=>[s("div",R1,[s("div",E1,[s("h3",H1,[we(" Select "),s("span",z1,T(o(He)(c.refInfo.model)),1)]),s("div",N1,[c.showPreferences?(a(),u("button",{key:0,type:"button",class:"pl-2 text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400",title:c.refInfo.model+" Preferences",onClick:e[0]||(e[0]=e=>z.value=!z.value)},Q1,8,U1)):k("",!0),c.showPagingNav?(a(),u("button",{key:1,type:"button",class:w(["pl-2",o(B)?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"First page",disabled:!o(B),onClick:e[1]||(e[1]=e=>P(-o(F)))},G1,10,K1)):k("",!0),c.showPagingNav?(a(),u("button",{key:2,type:"button",class:w(["pl-2",o(j)?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"Previous page",disabled:!o(j),onClick:e[2]||(e[2]=e=>P(-o(I)))},X1,10,W1)):k("",!0),c.showPagingNav?(a(),u("button",{key:3,type:"button",class:w(["pl-2",o(O)?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"Next page",disabled:!o(O),onClick:e[3]||(e[3]=e=>P(o(I)))},tm,10,Y1)):k("",!0),c.showPagingNav?(a(),u("button",{key:4,type:"button",class:w(["pl-2",o(H)?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"Last page",disabled:!o(H),onClick:e[4]||(e[4]=e=>P(o(F)))},sm,10,lm)):k("",!0)]),c.showPagingInfo?(a(),u("div",om,[s("div",am,[x.value?(a(),u("span",im,"Querying...")):k("",!0),o($).length?(a(),u("span",rm,[um,we(" "+T(b.value+1)+" - "+T(Math.min(b.value+o($).length,o(F)))+" ",1),s("span",null," of "+T(o(F)),1)])):h.value.completed?(a(),u("span",dm,"No Results")):k("",!0)])])):k("",!0),o(q)&&c.showResetPreferences?(a(),u("div",cm,[s("button",{type:"button",onClick:ne,title:"Reset Preferences & Filters",class:w(o(m))},mm,2)])):k("",!0),s("div",vm,[c.showFiltersView&&0<o(E)?(a(),u("div",hm,[s("button",{type:"button",onClick:e[5]||(e[5]=e=>C.value="filters"==C.value?null:"filters"),class:w(o(m)),"aria-expanded":"false"},[gm,s("span",pm,T(o(E))+" "+T(1==o(E)?"Filter":"Filters"),1),"filters"!=C.value?(a(),u("svg",ym,wm)):(a(),u("svg",xm,$m))],2)])):k("",!0)])]),"filters"==C.value?(a(),se(Sn,{key:0,class:"border-y border-gray-200 dark:border-gray-800 py-8 my-2",definitions:o(g),columns:D.value,onDone:e[6]||(e[6]=e=>C.value=null),onChange:le},null,8,["definitions","columns"])):k("",!0),_.value?(a(),u("div",Cm,[$e(Vn,{definitions:o(g),column:_.value.column,"top-left":_.value.topLeft,onDone:ee,onSave:te},null,8,["definitions","column","top-left"])])):k("",!0),h.value.error?(a(),se(t,{key:2,status:h.value.error},null,8,["status"])):x.value?(a(),se(n,{key:3})):(a(),u("div",_m,[o($).length?(a(),u("div",Lm,[$e(i,{id:c.id,items:o($),type:c.refInfo.model,"selected-columns":o(S),onFiltersChanged:U,tableStyle:"fullWidth",rowClass:L,onRowSelected:G,onHeaderSelected:Y},tn({header:ke(({column:t,label:e})=>{return[!c.allowFiltering||v.canFilter&&!v.canFilter(t)?(a(),u("div",Mm,[s("span",Am,T(e),1)])):(a(),u("div",Vm,[s("span",Sm,T(e),1),$e(r,{column:D.value.find(e=>e.name.toLowerCase()===t.toLowerCase()),"is-open":(null==(e=_.value)?void 0:e.column.name)===t},null,8,["column","is-open"])]))]}),_:2},[Ie(Object.keys(o(p)),t=>({name:t,fn:ke(e=>[Z(l.$slots,t,jt(gl(e)))])}))]),1032,["id","items","type","selected-columns"])])):k("",!0)]))])]),_:3},8,["id"])):k("",!0),z.value?(a(),se(Mn,{key:1,columns:o(M),prefs:y.value,onDone:e[7]||(e[7]=e=>z.value=!1),onSave:ae},null,8,["columns","prefs"])):k("",!0)],64)}}}),Fm={class:"sm:hidden"},Im=["for"],Dm=["id","name"],jm=["value"],Om={class:"hidden sm:block"},Pm={class:"border-b border-gray-200"},Bm={class:"-mb-px flex","aria-label":"Tabs"},Rm=["onClick"],Em=ce({__name:"Tabs",props:{tabs:null,id:{default:"tabs"},param:{default:"tab"},label:{type:Function,default:e=>He(e)},selected:null,tabClass:null,bodyClass:{default:"p-4"},url:{type:Boolean,default:!0}},setup(l){const t=l,n=f(()=>Object.keys(t.tabs)),r=e=>t.label?t.label(e):He(e),i=f(()=>t.id||"tabs"),d=f(()=>t.param||"tab"),c=A();function v(e){c.value=e,t.url&&nn({tab:e===n.value[0]?void 0:e})}const p=f(()=>100/Object.keys(t.tabs).length+"%");return tt(()=>{var e;c.value=t.selected||Object.keys(t.tabs)[0],t.url&&(e=location.search||(location.hash.includes("?")?"?"+dl(location.hash,"?"):""),e=zl(e)[d.value])&&(c.value=e)}),(e,t)=>(a(),u("div",null,[s("div",Fm,[s("label",{for:o(i),class:"sr-only"},"Select a tab",8,Im),s("select",{id:o(i),name:o(i),class:"block w-full rounded-md border-gray-300 focus:border-indigo-500 focus:ring-indigo-500",onChange:t[0]||(t[0]=e=>{return v(null==(e=e.target)?void 0:e.value)})},[(a(!0),u(Te,null,Ie(o(n),e=>(a(),u("option",{key:e,value:e},T(r(e)),9,jm))),128))],40,Dm)]),s("div",Om,[s("div",Pm,[s("nav",Bm,[(a(!0),u(Te,null,Ie(o(n),t=>{return a(),u("a",{href:"#",onClick:Ue(e=>v(t),["prevent"]),style:Xl({width:o(p)}),class:w([(e=t,c.value===e?"border-indigo-500 text-indigo-600 py-4 px-1 text-center border-b-2 font-medium text-sm":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 py-4 px-1 text-center border-b-2 font-medium text-sm"),l.tabClass])},T(r(t)),15,Rm);var e}),256))])])]),s("div",{class:w(l.bodyClass)},[(a(),se(Jn(l.tabs[c.value])))],2)]))}}),Hm=s("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4 text-gray-400",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 32 32"},[s("path",{fill:"currentColor",d:"M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3Z"})],-1),zm=[Hm],Nm=s("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4 text-indigo-600",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 32 32"},[s("path",{fill:"currentColor",d:"M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6ZM5.394 6.813L6.81 5.399l3.505 3.506L8.9 10.319zM2 15.005h5v2H2zm3.394 10.193L8.9 21.692l1.414 1.414l-3.505 3.506zM15 25.005h2v5h-2zm6.687-1.9l1.414-1.414l3.506 3.506l-1.414 1.414zm3.313-8.1h5v2h-5zm-3.313-6.101l3.506-3.506l1.414 1.414l-3.506 3.506zM15 2.005h2v5h-2z"})],-1),Um=[Nm],qm=ce({__name:"DarkModeToggle",setup(e){const l=typeof document<"u"?document.querySelector("html"):null;let n=A(null==l?void 0:l.classList.contains("dark"));return(e,t)=>(a(),u("button",{type:"button",class:"bg-gray-200 dark:bg-gray-700 relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:ring-offset-black",role:"switch","aria-checked":"false",onClick:t[0]||(t[0]=e=>{n.value?null!=l&&l.classList.remove("dark"):null!=l&&l.classList.add("dark"),n.value=!n.value,localStorage.setItem("color-scheme",n.value?"dark":"light")})},[s("span",{class:w(`${o(n)?"translate-x-0":"translate-x-5"} pointer-events-none relative inline-block h-5 w-5 rounded-full bg-white dark:bg-black shadow transform ring-0 transition ease-in-out duration-200`)},[s("span",{class:w(`${o(n)?"opacity-100 ease-in duration-200":"opacity-0 ease-out duration-100"} absolute inset-0 h-full w-full flex items-center justify-center transition-opacity`),"aria-hidden":"true"},zm,2),s("span",{class:w(`${o(n)?"opacity-0 ease-out duration-100":"opacity-100 ease-in duration-200"} absolute inset-0 h-full w-full flex items-center justify-center transition-opacity`),"aria-hidden":"true"},Um,2)],2)]))}}),Qm={key:0},Km={key:1,class:"min-h-full flex flex-col justify-center py-12 sm:px-6 lg:px-8"},Zm={class:"sm:mx-auto sm:w-full sm:max-w-md"},Gm={class:"mt-6 text-center text-3xl font-extrabold text-gray-900"},Wm={key:0,class:"mt-4 text-center text-sm text-gray-600"},Jm={class:"relative z-0 inline-flex shadow-sm rounded-md"},Xm=["onClick"],Ym={class:"mt-8 sm:mx-auto sm:w-full sm:max-w-md"},ev={class:"bg-white py-8 px-4 shadow sm:rounded-lg sm:px-10"},tv=["onSubmit"],lv={class:"mt-8"},nv={key:1,class:"mt-6"},sv=wl('<div class="relative"><div class="absolute inset-0 flex items-center"><div class="w-full border-t border-gray-300"></div></div><div class="relative flex justify-center text-sm"><span class="px-2 bg-white text-gray-500"> Or continue with </span></div></div>',1),ov={class:"mt-6 grid grid-cols-3 gap-3"},av=["href","title"],iv={key:1,class:"h-5 w-5 text-gray-700",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},rv=s("path",{d:"M16 8a5 5 0 1 0 5 5a5 5 0 0 0-5-5z",fill:"currentColor"},null,-1),uv=s("path",{d:"M16 2a14 14 0 1 0 14 14A14.016 14.016 0 0 0 16 2zm7.992 22.926A5.002 5.002 0 0 0 19 20h-6a5.002 5.002 0 0 0-4.992 4.926a12 12 0 1 1 15.985 0z",fill:"currentColor"},null,-1),dv=[rv,uv],cv=ce({__name:"SignIn",props:{provider:null,title:{default:"Sign In"},tabs:{type:[Boolean,String],default:!0},oauth:{type:[Boolean,String],default:!0}},emits:["login"],setup(c,{emit:t}){const l=c,{getMetadata:e,createDto:n}=at(),r=Tl(),i=Ne("client"),d=Ln()["signIn"],v=e({assert:!0}),p=v.plugins.auth,m=document.baseURI,g=v.app.baseUrl,y=A(n("Authenticate")),h=A(new Je),b=A(l.provider),x=(tt(()=>{null!=p&&p.authProviders.map(e=>e.formLayout).filter(e=>e).forEach(e=>e.forEach(e=>y.value[e.id]=""))}),f(()=>(null==p?void 0:p.authProviders.filter(e=>e.formLayout))||[])),C=f(()=>x.value[0]||{}),L=f(()=>x.value[Math.max(x.value.length-1,0)]||{}),V=f(()=>(b.value?null==p?void 0:p.authProviders.find(e=>e.name===b.value):null)??C.value),M=e=>!1===e||"false"===e;function S(e){return e.label||e.navItem&&e.navItem.label}const I=f(()=>{var e;return((null==(e=V.value)?void 0:e.formLayout)||[]).map(e=>{var t;return Object.assign({},e,{type:null==(t=e.type)?void 0:t.toLowerCase(),autocomplete:e.autocomplete||("password"===(null==(t=e.type)?void 0:t.toLowerCase())?"current-password":void 0)||("username"===e.id.toLowerCase()?"username":void 0),css:Object.assign({field:"col-span-12"},e.css)})})}),$=f(()=>!M(l.oauth)&&(null==p?void 0:p.authProviders.filter(e=>"oauth"===e.type))||[]),F=f(()=>{let e=_o(null==p?void 0:p.authProviders.filter(e=>e.formLayout&&0<e.formLayout.length),(e,t)=>{e[S(t)||st(t.name)]=t.name===C.value.name?"":t.name});var t=V.value;return e=t&&M(l.tabs)?{[S(t)||st(t.name)]:t}:e}),B=f(()=>{var e=I.value.map(e=>e.id).filter(e=>e);return h.value.summaryMessage(e)});async function j(){var e;y.value.provider=V.value.name,"authsecret"===V.value.name&&(i.headers.set("authsecret",y.value.authsecret),y.value=n("Authenticate")),h.value=await r.api(y.value),h.value.succeeded&&(e=h.value.response,d(e),t("login",e),h.value=new Je,y.value=n("Authenticate"))}return(e,t)=>{const l=X("ErrorSummary"),n=X("AutoFormFields"),r=X("PrimaryButton"),i=X("Icon"),d=ro("href");return o(p)?(a(),u("div",Km,[s("div",Zm,[s("h2",Gm,T(c.title),1),1<Object.keys(o(F)).length?(a(),u("p",Wm,[s("span",Jm,[(a(!0),u(Te,null,Ie(o(F),(t,e)=>kt((a(),u("a",{onClick:e=>b.value=t,class:w([""===t||t===o(C).name?"rounded-l-md":t===o(L).name?"rounded-r-md -ml-px":"-ml-px",b.value===t?"z-10 outline-none ring-1 ring-indigo-500 border-indigo-500":"","cursor-pointer relative inline-flex items-center px-4 py-1 border border-gray-300 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50"])},[we(T(e),1)],10,Xm)),[[d,{provider:t}]])),256))])])):k("",!0)]),s("div",Ym,[o(B)?(a(),se(l,{key:0,class:"mb-3",errorSummary:o(B)},null,8,["errorSummary"])):k("",!0),s("div",ev,[o(I).length?(a(),u("form",{key:0,onSubmit:Ue(j,["prevent"])},[$e(n,{modelValue:y.value,formLayout:o(I),api:h.value,hideSummary:!0,"divide-class":"","space-class":"space-y-6"},null,8,["modelValue","formLayout","api"]),s("div",lv,[$e(r,{class:"w-full"},{default:ke(()=>[we("Sign In")]),_:1})])],40,tv)):k("",!0),o($).length?(a(),u("div",nv,[sv,s("div",ov,[(a(!0),u(Te,null,Ie(o($),e=>(a(),u("div",null,[s("a",{href:o(g)+e.navItem.href+"?continue="+o(m),title:S(e),class:"w-full inline-flex justify-center py-2 px-4 border border-gray-300 rounded-md shadow-sm bg-white text-sm font-medium text-gray-500 hover:bg-gray-50"},[e.icon?(a(),se(i,{key:0,image:e.icon,class:"h-5 w-5 text-gray-700"},null,8,["image"])):(a(),u("svg",iv,dv))],8,av)]))),256))])])):k("",!0)])])])):(a(),u("div",Qm,"No Auth Plugin"))}}}),fv=["for"],mv={key:1,class:"border border-gray-200 flex justify-between"},vv={class:"p-2 flex flex-wrap gap-x-4"},hv=s("title",null,"Bold text (CTRL+B)",-1),gv=s("path",{fill:"currentColor",d:"M15.6 10.79c.97-.67 1.65-1.77 1.65-2.79c0-2.26-1.75-4-4-4H7v14h7.04c2.09 0 3.71-1.7 3.71-3.79c0-1.52-.86-2.82-2.15-3.42zM10 6.5h3c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-3v-3zm3.5 9H10v-3h3.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5z"},null,-1),pv=[hv,gv],yv=s("title",null,"Italics (CTRL+I)",-1),bv=s("path",{fill:"currentColor",d:"M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4h-8z"},null,-1),wv=[yv,bv],xv=s("title",null,"Insert Link (CTRL+K)",-1),kv=s("path",{fill:"currentColor",d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7a5 5 0 0 0-5 5a5 5 0 0 0 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1M8 13h8v-2H8v2m9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1c0 1.71-1.39 3.1-3.1 3.1h-4V17h4a5 5 0 0 0 5-5a5 5 0 0 0-5-5Z"},null,-1),$v=[xv,kv],Cv=s("title",null,"Blockquote (CTRL+Q)",-1),_v=s("path",{fill:"currentColor",d:"m15 17l2-4h-4V6h7v7l-2 4h-3Zm-9 0l2-4H4V6h7v7l-2 4H6Z"},null,-1),Lv=[Cv,_v],Vv=s("title",null,"Insert Image (CTRL+SHIFT+L)",-1),Sv=s("path",{fill:"currentColor",d:"M2.992 21A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993H2.992ZM20 15V5H4v14L14 9l6 6Zm0 2.828l-6-6L6.828 19H20v-1.172ZM8 11a2 2 0 1 1 0-4a2 2 0 0 1 0 4Z"},null,-1),Mv=[Vv,Sv],Av=s("title",null,"Insert Code (CTRL+<)",-1),Tv=s("path",{fill:"currentColor",d:"m8 18l-6-6l6-6l1.425 1.425l-4.6 4.6L9.4 16.6L8 18Zm8 0l-1.425-1.425l4.6-4.6L14.6 7.4L16 6l6 6l-6 6Z"},null,-1),Fv=[Av,Tv],Iv=s("title",null,"H2 Heading (CTRL+H)",-1),Dv=s("path",{fill:"currentColor",d:"M7 20V7H2V4h13v3h-5v13H7Zm9 0v-8h-3V9h9v3h-3v8h-3Z"},null,-1),jv=[Iv,Dv],Ov=s("title",null,"Numbered List (ALT+1)",-1),Pv=s("path",{fill:"currentColor",d:"M3 22v-1.5h2.5v-.75H4v-1.5h1.5v-.75H3V16h3q.425 0 .713.288T7 17v1q0 .425-.288.713T6 19q.425 0 .713.288T7 20v1q0 .425-.288.713T6 22H3Zm0-7v-2.75q0-.425.288-.713T4 11.25h1.5v-.75H3V9h3q.425 0 .713.288T7 10v1.75q0 .425-.288.713T6 12.75H4.5v.75H7V15H3Zm1.5-7V3.5H3V2h3v6H4.5ZM9 19v-2h12v2H9Zm0-6v-2h12v2H9Zm0-6V5h12v2H9Z"},null,-1),Bv=[Ov,Pv],Rv=s("title",null,"Bulleted List (ALT+-)",-1),Ev=s("path",{fill:"currentColor",d:"M9 19v-2h12v2H9Zm0-6v-2h12v2H9Zm0-6V5h12v2H9ZM5 20q-.825 0-1.413-.588T3 18q0-.825.588-1.413T5 16q.825 0 1.413.588T7 18q0 .825-.588 1.413T5 20Zm0-6q-.825 0-1.413-.588T3 12q0-.825.588-1.413T5 10q.825 0 1.413.588T7 12q0 .825-.588 1.413T5 14Zm0-6q-.825 0-1.413-.588T3 6q0-.825.588-1.413T5 4q.825 0 1.413.588T7 6q0 .825-.588 1.413T5 8Z"},null,-1),Hv=[Rv,Ev],zv=s("title",null,"Strike Through (ALT+S)",-1),Nv=s("path",{fill:"currentColor",d:"M10 19h4v-3h-4v3zM5 4v3h5v3h4V7h5V4H5zM3 14h18v-2H3v2z"},null,-1),Uv=[zv,Nv],qv=s("title",null,"Undo (CTRL+Z)",-1),Qv=s("path",{fill:"currentColor",d:"M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88c3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"},null,-1),Kv=[qv,Qv],Zv=s("title",null,"Redo (CTRL+SHIFT+Z)",-1),Gv=s("path",{fill:"currentColor",d:"M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 0 1 7.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"},null,-1),Wv=[Zv,Gv],Jv={key:0,class:"p-2 flex flex-wrap gap-x-4"},Xv=["href"],Yv=s("path",{fill:"currentColor",d:"M11 18h2v-2h-2v2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8s8 3.59 8 8s-3.59 8-8 8zm0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5c0-2.21-1.79-4-4-4z"},null,-1),eh=[Yv],th={class:""},lh=["name","id","label","value","rows","disabled","onKeydown"],nh=["id"],sh=["id"],oh=ce({__name:"MarkdownInput",props:{status:null,id:null,inputClass:null,label:null,labelClass:null,help:null,placeholder:null,modelValue:null,counter:{type:Boolean},rows:null,errorMessages:null,lang:null,autoFocus:{type:Boolean},disabled:{type:Boolean},helpUrl:{default:"https://guides.github.com/features/mastering-markdown/"},hide:null},emits:["update:modelValue","close"],setup(n,{expose:e,emit:l}){const r=n;let g=[],y=[],t=Ne("ApiState",void 0);const i=f(()=>mt.call({responseStatus:r.status??(null==t?void 0:t.error.value)},r.id)),d=f(()=>r.label??He(st(r.id))),c="bold,italics,link,image,blockquote,code,heading,orderedList,unorderedList,strikethrough,undo,redo,help".split(","),v=f(()=>r.hide?wt(c,r.hide):wt(c,[]));function p(e){return v.value[e]}const m=f(()=>["shadow-sm font-mono"+nt.base.replace("rounded-md",""),i.value?"text-red-900 focus:ring-red-500 focus:border-red-500 border-red-300":"text-gray-900 "+nt.valid,r.inputClass]),h="w-5 h-5 cursor-pointer select-none text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400",b=A();function x(e){l("update:modelValue",e)}function C(){return b.value.selectionStart!==b.value.selectionEnd}function L(){var e=b.value;return e.value.substring(e.selectionStart,e.selectionEnd)||""}function V(){var e=b.value,t=e.value,l=e.selectionStart,e=t.substring(l,e.selectionEnd)||"",a=t.substring(0,l),s=a.lastIndexOf(`
`);return{value:t,sel:e,selPos:l,beforeSel:a,afterSel:t.substring(l),prevCRPos:s,beforeCR:0<=s?a.substring(0,s+1):"",afterCR:0<=s?a.substring(s+1):""}}function M({value:e,selectionStart:t,selectionEnd:l}){null==l&&(l=t),x(e),xt(()=>{b.value.focus(),b.value.setSelectionRange(t,l)})}function S(e,t,l="",{selectionAtEnd:a,offsetStart:s,offsetEnd:n,filterValue:o,filterSelection:r}={}){const i=b.value;let u=i.value,d=i.selectionEnd;g.push({value:u,selectionStart:i.selectionStart,selectionEnd:i.selectionEnd}),y=[];var c=i.selectionStart,v=i.selectionEnd,f=u.substring(0,c),p=u.substring(v),m=e&&f.endsWith(e)&&p.startsWith(t);c==v?(m?(u=f.substring(0,f.length-e.length)+p.substring(t.length),d+=-t.length):(u=f+e+l+t+p,d+=e.length,s=0,n=(null==l?void 0:l.length)||0,a&&(d+=n,n=0)),o&&(l={pos:d},u=o(u,l),d=l.pos)):(a=u.substring(c,v),r&&(a=r(a)),m?(u=f.substring(0,f.length-e.length)+a+p.substring(t.length),s=-a.length-e.length,n=a.length):(u=f+e+a+t+p,s?d+=(e+t).length:(d=c,s=e.length,n=a.length))),x(u),xt(()=>{i.focus(),s=d+(s||0),n=(s||0)+(n||0),i.setSelectionRange(s,n)})}e({props:r,textarea:b,updateModelValue:x,selection:L,hasSelection:C,selectionInfo:V,insert:S,replace:M});const I=()=>S("**","**","bold"),$=()=>S("_","_","italics"),F=()=>S("~~","~~","strikethrough"),B=()=>S("[","](https://)","",{offsetStart:-9,offsetEnd:8}),j=()=>S(`
> `,`
`,"Blockquote",{}),O=()=>S("![](",")");function H(e){var t=L();t&&!e.shiftKey?S("`","`","code"):(e=r.lang||"js",-1===t.indexOf(`
`)?S("\n```"+e+`
`,"\n```\n","// code"):S("```"+e+`
`,"```\n",""))}function D(){if(C()){let{sel:e,beforeSel:a,afterSel:s,prevCRPos:n,beforeCR:o,afterCR:r}=V();if(-1===e.indexOf(`
`))S(`
 1. `,`
`);else if(e.startsWith(" 1. "))S("","","",{filterValue:(e,t)=>{var l;return 0<=n&&(l=r.replace(/^ - /,""),a=o+l,t.pos-=r.length-l.length),a+s},filterSelection:e=>e.replace(/^ 1. /g,"").replace(/\n \d+. /g,`
`)});else{let t=1;S("",""," - ",{selectionAtEnd:!0,filterSelection:e=>" 1. "+e.replace(/\n$/,"").replace(/\n/g,e=>`
 ${++t}. `)+`
`})}}else S(`
 1. `,`
`,"List Item",{offsetStart:-10,offsetEnd:9})}function E(){if(C()){let{sel:e,beforeSel:a,afterSel:s,prevCRPos:n,beforeCR:o,afterCR:r}=V();-1===e.indexOf(`
`)?S(`
 - `,`
`):e.startsWith(" - ")?S("","","",{filterValue:(e,t)=>{var l;return 0<=n&&(l=r.replace(/^ - /,""),a=o+l,t.pos-=r.length-l.length),a+s},filterSelection:e=>e.replace(/^ - /g,"").replace(/\n - /g,`
`)}):S("",""," - ",{selectionAtEnd:!0,filterSelection:e=>" - "+e.replace(/\n$/,"").replace(/\n/g,`
 - `)+`
`})}else S(`
 - `,`
`,"List Item",{offsetStart:-10,offsetEnd:9})}function z(){var e=L(),t=-1===e.indexOf(`
`);e?t?S(`
## `,`
`,""):S("## ","",""):S(`
## `,`
`,"Heading",{offsetStart:-8,offsetEnd:7})}function _(){var e,t;return 0!==g.length&&(e=b.value,t=g.pop(),y.push({value:e.value,selectionStart:e.selectionStart,selectionEnd:e.selectionEnd}),M(t),!0)}function R(){var e,t;return 0!==y.length&&(e=b.value,t=y.pop(),g.push({value:e.value,selectionStart:e.selectionStart,selectionEnd:e.selectionEnd}),M(t),!0)}const N=()=>null;return tt(()=>{g=[],y=[],b.value.onkeydown=e=>{if("Escape"===e.key||27===e.keyCode)l("close");else{var t=String.fromCharCode(e.keyCode).toLowerCase();if("\t"===t)e.shiftKey?S("","","",{filterValue:(e,t)=>{let{beforeSel:l,afterSel:a,prevCRPos:s,beforeCR:n,afterCR:o}=V();var r;return 0<=s&&(r=o.replace(/\t/g,"    ").replace(/^ ? ? ? ?/,""),l=n+r,t.pos-=o.length-r.length),l+a},filterSelection:e=>e.replace(/\t/g,"    ").replace(/^ ? ? ? ?/g,"").replace(/\n    /g,`
`)}):S("","","    ",{selectionAtEnd:!0,filterSelection:e=>"    "+e.replace(/\n$/,"").replace(/\n/g,`
    `)+`
`}),e.preventDefault();else if(e.ctrlKey)if("z"===t)e.shiftKey?R()&&e.preventDefault():_()&&e.preventDefault();else if("b"!==t||e.shiftKey)if("h"!==t||e.shiftKey)if("i"!==t||e.shiftKey)if("q"!==t||e.shiftKey)if("k"===t)(e.shiftKey?O:B)(),e.preventDefault();else if(","===t||"<"===e.key||">"===e.key||188===e.keyCode)H(e),e.preventDefault();else if("/"!==t&&"/"!==e.key)"?"!==t&&"?"!==e.key||!e.shiftKey||(S(`/*
`,`*/
`,""),e.preventDefault());else{{let{sel:e,selPos:t,beforeSel:a,afterSel:s,prevCRPos:n,beforeCR:o,afterCR:r}=V();e.startsWith("//")||r.startsWith("//")?S("","","",{filterValue:(e,t)=>{var l;return 0<=n&&(l=r.replace(/^\/\//,""),a=o+l,t.pos-=r.length-l.length),a+s},filterSelection:e=>e.replace(/^\/\//g,"").replace(/\n\/\//g,`
`)}):e?S("","","//",{selectionAtEnd:!0,filterSelection:e=>"//"+e.replace(/\n$/,"").replace(/\n/g,`
//`)+`
`}):M({value:o+"//"+r+s,selectionStart:t+2})}e.preventDefault()}else j(),e.preventDefault();else $(),e.preventDefault();else z(),e.preventDefault();else I(),e.preventDefault();else e.altKey&&("1"===e.key||"0"===e.key?(D(),e.preventDefault()):"-"===e.key?(E(),e.preventDefault()):"s"===e.key&&(F(),e.preventDefault()))}}}),(e,t)=>{var l;return a(),u("div",null,[Z(e.$slots,"header",Me({inputElement:b.value,id:n.id,modelValue:n.modelValue,status:n.status},e.$attrs)),o(d)?(a(),u("label",{key:0,for:n.id,class:w("mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300 "+(n.labelClass??""))},T(o(d)),11,fv)):k("",!0),n.disabled?k("",!0):(a(),u("div",mv,[s("div",vv,[p("bold")?(a(),u("svg",{key:0,class:w(h),onClick:I,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},pv)):k("",!0),p("italics")?(a(),u("svg",{key:1,class:w(h),onClick:$,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},wv)):k("",!0),p("link")?(a(),u("svg",{key:2,class:w(h),onClick:B,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},$v)):k("",!0),p("blockquote")?(a(),u("svg",{key:3,class:w(h),onClick:j,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Lv)):k("",!0),p("image")?(a(),u("svg",{key:4,class:w(h),onClick:O,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Mv)):k("",!0),p("code")?(a(),u("svg",{key:5,class:w(h),onClick:H,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Fv)):k("",!0),p("heading")?(a(),u("svg",{key:6,class:w(h),onClick:z,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},jv)):k("",!0),p("orderedList")?(a(),u("svg",{key:7,class:w(h),icon:"",onClick:D,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Bv)):k("",!0),p("unorderedList")?(a(),u("svg",{key:8,class:w(h),onClick:E,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Hv)):k("",!0),p("strikethrough")?(a(),u("svg",{key:9,class:w(h),onClick:F,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Uv)):k("",!0),p("undo")?(a(),u("svg",{key:10,class:w(h),onClick:_,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Kv)):k("",!0),p("redo")?(a(),u("svg",{key:11,class:w(h),onClick:R,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Wv)):k("",!0),Z(e.$slots,"toolbarbuttons",{instance:null==(l=Be())?void 0:l.exposed})]),p("help")&&n.helpUrl?(a(),u("div",Jv,[s("a",{title:"formatting help",target:"_blank",href:n.helpUrl,tabindex:"-1"},[(a(),u("svg",{class:w(h),xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},eh))],8,Xv)])):k("",!0)])),s("div",th,[s("textarea",{ref_key:"txt",ref:b,name:n.id,id:n.id,class:w(o(m)),label:n.label,value:n.modelValue,rows:n.rows||6,disabled:n.disabled,onInput:t[0]||(t[0]=e=>{return x((null==(e=e.target)?void 0:e.value)||"")}),onKeydown:Wn(N,["tab"])},null,42,lh)]),o(i)?(a(),u("p",{key:2,class:"mt-2 text-sm text-red-500",id:n.id+"-error"},T(o(i)),9,nh)):n.help?(a(),u("p",{key:3,class:"mt-2 text-sm text-gray-500",id:n.id+"-description"},T(n.help),9,sh)):k("",!0),Z(e.$slots,"footer",Me({inputElement:b.value,id:n.id,modelValue:n.modelValue,status:n.status},e.$attrs))])}}}),ah={key:0,class:"relative z-10 lg:hidden",role:"dialog","aria-modal":"true"},ih={class:"fixed inset-0 flex"},rh=s("span",{class:"sr-only"},"Close sidebar",-1),uh=s("svg",{class:"h-6 w-6 text-white",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true"},[s("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1),dh=[rh,uh],ch={class:"flex grow flex-col gap-y-5 overflow-y-auto bg-white px-6 pb-2"},fh={class:"hidden lg:fixed lg:inset-y-0 lg:z-10 lg:flex lg:w-72 lg:flex-col"},mh={class:"flex grow flex-col gap-y-5 overflow-y-auto border-r border-gray-200 bg-white px-6"},vh={class:w(["sticky top-0 flex items-center gap-x-6 bg-white px-4 py-4 shadow-sm sm:px-6 lg:hidden"])},hh=s("span",{class:"sr-only"},"Open sidebar",-1),gh=s("svg",{class:"h-6 w-6",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true"},[s("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"})],-1),ph=[hh,gh],yh=ce({__name:"SidebarLayout",setup(e,{expose:t}){const l=is()["transition"],n=A(!0),o=A(""),r={entering:{cls:"transition-opacity ease-linear duration-300",from:"opacity-0",to:"opacity-100"},leaving:{cls:"transition-opacity ease-linear duration-300",from:"opacity-100",to:"opacity-0"}},i=A(""),d={entering:{cls:"transition ease-in-out duration-300 transform",from:"-translate-x-full",to:"translate-x-0"},leaving:{cls:"transition ease-in-out duration-300 transform",from:"translate-x-0",to:"-translate-x-full"}},c=A(""),v={entering:{cls:"ease-in-out duration-300",from:"opacity-0",to:"opacity-100"},leaving:{cls:"ease-in-out duration-300",from:"opacity-100",to:"opacity-0"}};function f(e){l(r,o,e),l(d,i,e),l(v,c,e),setTimeout(()=>n.value=e,300)}function p(){f(!0)}function m(){f(!1)}return t({show:p,hide:m,toggle:f}),(e,t)=>(a(),u("div",null,[n.value?(a(),u("div",ah,[s("div",{class:w(["fixed inset-0 bg-gray-900/80",o.value])},null,2),s("div",ih,[s("div",{class:w(["relative mr-16 flex w-full max-w-xs flex-1",i.value])},[s("div",{class:w(["absolute left-full top-0 flex w-16 justify-center pt-5",c.value])},[s("button",{type:"button",onClick:m,class:"-m-2.5 p-2.5"},dh)],2),s("div",ch,[Z(e.$slots,"default")])],2)])])):k("",!0),s("div",fh,[s("div",mh,[Z(e.$slots,"default")])]),s("div",vh,[s("button",{type:"button",onClick:p,class:"-m-2.5 p-2.5 text-gray-700 lg:hidden"},ph),Z(e.$slots,"mobiletitlebar")])]))}}),bh={Alert:Eo,AlertSuccess:Xo,ErrorSummary:na,InputDescription:oa,Icon:zs,Loading:Xa,OutlineButton:ti,PrimaryButton:si,SecondaryButton:ii,TextLink:ui,Breadcrumbs:hi,Breadcrumb:wi,NavList:$i,NavListItem:Di,AutoQueryGrid:nd,SettingsIcons:pd,FilterViews:Sn,FilterColumn:Vn,QueryPrefs:Mn,EnsureAccess:qs,EnsureAccessDialog:yd,TextInput:Sd,TextareaInput:jd,SelectInput:Hd,CheckboxInput:Gd,TagInput:yc,FileInput:Hc,Autocomplete:n0,Combobox:a0,DynamicInput:i0,LookupInput:$0,AutoFormFields:C0,AutoForm:K0,AutoCreateForm:pf,AutoEditForm:Ef,ConfirmDelete:Nf,FormLoading:Gf,DataGrid:e1,CellFormat:t1,PreviewFormat:i1,HtmlFormat:f1,CloseButton:p1,SlideOver:T1,ModalDialog:B1,ModalLookup:Tm,Tabs:Em,DarkModeToggle:qm,SignIn:cv,MarkdownInput:oh,SidebarLayout:yh},El=bh,Lh={install(t){function l(t){var e=Object.keys(t).filter(e=>t[e]).map(e=>encodeURIComponent(e)+"="+encodeURIComponent(t[e])).join("&");return e?"?"+e:"./"}Object.keys(El).forEach(e=>{t.component(e,El[e])}),t.directive("href",function(e,t){e.href=l(t.value),e.onclick=e=>{e.preventDefault(),history.pushState(t.value,"",l(t.value))}})},component(e,t){return e?t?ne.components[e]=t:ne.components[e]||El[e]||null:null}};export{_h as css,Lh as default,Ln as useAuth,Tl as useClient,St as useConfig,$h as useFiles,Ch as useFormatters,at as useMetadata,is as useUtils};